Class Work
Topic 9-1: Animal List
The purpose of this exercise is to use practice working with lists.
1. Create a new Alice world.
2. Add 6 different animal objects to the world.
3. Create a list variable and add the six animals to it.
4. Write the following methods.
A. Method spinOneAtATime. Spin each animal all the way around once, one at a time.
B. Method jumpUpAndDownWhileWiggling. All the animals jump .25 meters and come back down to the ground. The animals wiggle their legs while they are in the air. The animals all jump at the same time.
C. Method compareHeightsWithOneObject. This method accepts a parameter that is an object and another that is a list of objects. The animal passed in as the object says "I'm it". The method then compares the single animal with all the animals in the list, one at a time. If the heights are the same the animal from the list says "the same". If the heights are different the animal who is shorter says "I'm shorter" and the animal who is taller says "I'm taller".
D. Method compareAllHeights. Compare all the heights of all pairs of animals. For each animal in the list have it say "Compare Me" and then compare it to the other animals inthe list by calling the compareHeightsWithOneObject method.