You are
on
your honor to make a good-faith effort to solve problems on your
own, or with your partners, before using these hints. This typically
means
at least 10 minutes of brainstorming, attacking the problem
with pencil and paper, drawing small diagrams, and so on. The hints are
provided with the intention of reducing frustration when course staff
support is not available.
The hints are written in white text on a white background. On most browsers
you make the hint visible by moving your mouse over it. If that
doesn't work, click your mouse on the screen and drag it over the box: the
text will become visible. Try it out on the apparently-empty box below:
If you can read these words, you are doing it correctly.
Question 1
Use a for loop.
Exercise A
Hint:
Person alyssa = new Person("Alyssa");
alyssa.say("Hamsters and rangers everywhere, rejoice!");
Exercise B
Hint 1 (making places and neighbors):
Place home = new Place("Home");
Place away = new Place("Away");
home.add_neighbor("outside", away);
away.add_neighbor("home", home);
Hint 2 (installing a person):
Person me = new Person("Me")
me.install(home)
me.look()
Hint 3 (installing a thing):
OwnableObject heart = new OwnableObject("Heart");
heart.install(home);
me.look();
me.take(heart);
me.go("outside");
me.look();
me.go("home");
me.lose(heart);