| 1. |
King Java's castle, shown in Figure 1, needs
to be guarded.
- (Not for this year.) Draw the class diagram of a GuardBot robot. Don't forget to show the various methods, etc.
that are special to GuardBot.
- Write a GuardBot class, that extends RobotSE, to patrol the
castle walls in the pattern shown. Choose an appropriate place for the
guard to begin its duties. A GuardBot should travel all the way around the
castle.
- Write a RobotTask application that uses four GuardBots to patrol the
castle, start one on each side.
- Modify your solution so that all the guards patrol their wall
simultaneously. Hint: use threads.
Test your programs thoroughly. Document
your task code properly.
Do NOT hand in your work unless other instructions were given.
|