CSCE 145 Lab Test 1

Section 4

Create a robot, CleanerBot, that inherits from Robot (not RobotSE) that will travel along a walkway picking up trash (Things) until it hits a Wall. When the Robot hits the Wall, it goes around it, dumps the trash (drops the Things), then returns home. There can be any number of Things to pick up and the Wall can be at any avenue, but everything will always be on the same street (1) and the Things will always be before the wall.

You should have different methods to:

. You should also have a method, clean(), that calls these methods in the appropriate order to do everything.

This picture shows how you should set up your City initially:




Remember, this is just a sample of where the Things and Wall could be. To make sure your code works you should try it with the Things and Wall at different avenues.

Create a main method where you create your City, instantiate your robot, and call clean().

The final situation should look like this:




DROPBOX YOUR .java FILES BEFORE 12:55PM (end of lab)! Don't wait until the last minute!