hts.StevenWood.com

Karel 4a

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

Karel 4a

Complete the following in class or for homework.

1.

Use the concept of inheritance and overriding methods, as taught in class to define a CautiousRobot. CautiousRobots are a child of RobotSE (a built-in, "special edition" robot with more capabilities than the basic Robot). CautiousRobots are magenta in colour.

When this robot's move method is called, this type of robot first looks right and then looks left and then moves forward one block.

Create a new file for this question where you create the robot and then instruct the CautiousRobot to move forward and clean up the 4 things directly in front of it. Start the robot at avenue 1 and street 2, heading south as shown

Test your program thoroughly. Document your task code properly.

Do NOT hand in your work unless other instructions were given.

 
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+