You would like to send a greeting to
astronauts in the International Space Station orbiting Earth. Create these robots by extending the RobotSE class. The robots can be
used to "write" the message "Hello" by lighting
bonfires (Things). The final situation is shown below. There are 4 types
of robots:
- one that makes an "H",
- one that makes
an "E",
- one that makes an "L" (note that you will need two of
these), and
- one that makes an
"O".
a) Write a RobotTask program that uses 5 robots, one for each letter.
Instantiate each robot with sufficient Things in its backpack. (Check the documentation for the Robot class for details on the proper constructor.) Hint: add a 5th item on the constructor line. This item represents the number of items (Things) that start in the backpack.

e.g. Robot blah = new Robot ( nyc, 1, 7, Direction.NORTH, 5 )
b) Set the size of the city
The default window for the city is too small to see the entire message. With the following City contructor you can set the size of the window to match the size of the message:

e.g. City blah = new City ( numVisibleStreets, numVisibleAvenues )
Test your programs thoroughly. Document
your task code properly.
Do NOT hand in your work unless other instructions were given.
|