| King Java's neighbour, King Caffeine, is very
impressed with the GuardBots developed for King Java. King Caffeine, would
like to hire four to patrol his castle. There is just one problem; his
castle is slightly different as shown in Figure 2. You will create two
sub-classes of GuardBot: LongWallGuard and ShortWallGuard.
a) (Not for this year.) Draw a class diagram of the GuardBot, LongWallGuard and
ShortWallGuard. Don't forget to show the various methods, etc. of each.
Show the connection between the 3 types of robots and RobotSE.
b) Develop the three classes named GuardBot (from the previous question), LongWallGuard and
ShortWallGuard. Make sure that the robots cover all of their wall. Have
the robot return to its original position (make one circuit of the wall).
c) Write a RobotTask application that uses two LongWallGuards and two
ShortWallGuardsBots to patrol the castle, one on each side.
d) Modify your solution so that all the guards patrol their wall
simultaneously by using threads.
Test your programs thoroughly. Document
your task code properly.
Do NOT hand in your work unless other instructions were given.
|