Lab 3
The following exercises are to be completed during lab class. If you do
not have time to finish during lab, they must be completed before the beginning
of the following lab session. You will turn in the lab gradesheet
at the beginning of the following lab.
Before beginning the exercises, copy this lab's folder from the T: drive to
your H: drive.
-
Complete exercise 2.9 on page 109 of your textbook.
Note that part b will require you to override the move method. Refer to your
Lab 2 Handout if you need help remembering how to create a class.
-
Complete exercise 1.16 on page 50 of your textbook, except make the Robot on
the right (east) be a TrailBot instead of a Robot.
Confirm that the Robot does not leave a trail of Things, but the TrailBot does.
Use the move() method (service) for both robots. Do not use
the trailMove() method for the TrailBot robot.
Name your solution class RobotMeeting. Note: TrailBot.java and
RobotMeeting.java will have to be in the same Java project to work correctly.
-
Complete part a of exercise 2.13 on page 110 of your textbook.
Name the file with main for part a Hello.java.
Write a second main that uses the WriterBot class to write the word "HOLE".
Name that file Hole.java.
NOTE: Be sure each window is wide enough to show the complete word. Include
WriterBot.java, Hello.java, and Hole.java in your zip file.
Use the windows zip utility to zip all required files into a single zip folder.
Submit the single zip folder to your lab section under project #3 using Web
Submit.
NOTE: Do NOT put your files into a folder to be zipped as this will make grading
more complicated. Simply select the necessary .java files, right click, choose
Send To = > Compressed (zipped) Folder.