Homework 2
Home   Lectures   Solutions   Syllabus      Instructor's Site  
Homework 2 - Due Tuesday 13 February at your lab time.

  1. On paper, create an organizational chart showing a top-down, modular design for each of the following:
    1. Baking a cake
    2. Traveling from your house to Buckingham Palace in London.
    3. Sorting a list of names alphabetically by last name.
    Bring your writeup to lab on 13 February.
  2.  
  3. (Hw2Ex2.a2w) Open an Alice world with a bunny in it. Create a hop method for the bunny that has the object move forward while jumping up and then down. (Hint: Use the do together control tile.) Your method should be defined with two parameters: how high, and how far. When called, bunny.hop should cause the bunny to jump forward how far meters while jumping up and down how high meters. Submit your world to the K drive as Hw2Ex2.aw2.
  4.  
  5. (Hw2Ex3.a2w) Write a more generic version of hop for the world object. world.hop should accept a parameter, who, in addition to how high, and how far. It should be possible to use world.hop to make any object in your world hop simply by passing it as the value of the who parameter in a call to world.hop. Submit your world to the K drive as Hw2Ex3.a2w.
  6.  
  7. Select one of the themed folders in the Alice galleries, such as the Japan, Egypt, or Old West folders. Select several objects from the folder and develop an outline for a short story using those objects. On paper, create an organizational chart that shows the modules in the story, and develop a list of the Alice methods that you would need to write to implement your story as an Alice world. Which of these methods do you think would be reusable for other stories? Bring your writeup to lab on 13 February.