CompSci 4 - Classwork 17 - November 3, 2011
10 pts

Today's classwork goes along with Chapter 9. We will get more practice with lists.

The following work needs to be checked off when you have completed it.

Today you will sort animals by their height. You are given some animals and some tennisballs already placed in the world. The tennis balls are evenly spaced and represent positions where the animals will stand in sorted order based on their height. The animals are standing behind the tennis balls. In this classwork, you will place the tallest animal to be positioned at the rightmost tennis ball. Then you will declare this animal and tennis ball "taken" so they will not be considered again. Next you will place the tallest animal (of those not taken yet) at the rightmost tennis ball (of those not taken yet). This is really the second tallest animal. Etc. Finally the shortest animal is to be positioned at the leftmost tennis ball.

A player is considered "taken" if it has been placed in sorted position. We will use a boolean class variable isTaken to indicate if a player is taken or not. If a player is taken, then you should not compare it with other players.

Tennis balls will be considered taken if their color is NOT yellow. A tennis ball is taken if a player has been placed in sorted order at that tennis ball. To make a tennis ball taken, you must change its color to something other than yellow, such as red.

If you finish early, feel free to embelish your animations.