|
Homework 2 - Due
Tuesday 13 February at your lab time.
- On paper, create an organizational chart showing a top-down, modular
design for each of the following:
-
Baking a cake
-
Traveling from your house to Buckingham Palace in London.
-
Sorting a list of names alphabetically by last name.
Bring your writeup to lab on 13 February.
-
(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.
-
(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.
-
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.
|
|
|