hts.StevenWood.com

Karel 6b

Home ] Up ] Karel 1 ] Karel 1b ] Karel 2 ] Karel 2b ] Karel 3 ] Karel 4 ] Karel 5 ] Karel 5b ] Karel 6 ] [ Karel 6b ] Graphics: Types some words ] Graphics: Spell your name ] Graphics: Fall scene ][ Last Page ]

Karel 6b: 

Complete the following in class or for homework.

1. 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.

 

Here is the castle text file.
(Thanks Tommy!)

 

YOU MUST adjust the size of the city IN the text file so you can see all of the castle and the robots WITHOUT having to resize the window. (Hint: look for the line near the top of the text file that indicates the number of streets and avenues.)

 
Home ] Up ] Karel 1 ] Karel 1b ] Karel 2 ] Karel 2b ] Karel 3 ] Karel 4 ] Karel 5 ] Karel 5b ] Karel 6 ] [ Karel 6b ] Graphics: Types some words ] Graphics: Spell your name ] Graphics: Fall scene ][Last Page]
All material on this site is copyright © 1997- by Steven Wood or as credited. All right reserved. Use of this site indicates you agreement with the  terms of use.
Send comments or questions to about this page.
Every attempt has been made to credit work under copyright. If there are any claims that copyright has been missed please contact the .
+SDG+