Lab 4

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.

  1. Complete exercise 2.16 on page 111 of your textbook.
    Call your test program TestFrame.java. Include CloseableJFrame.java and TestFrame.java in your zip file.
    NOTE: The submitted version of CloseableJFrame will have 2 constructors. This program is very small and does not do much.
     
  2. Complete exercise 3.9 on page 162 of your textbook. Call your Robot class for a, b, and c GardenRobot.

For part a: Call the main program for part a OneGardener.java

For part b: Call the main program for part b FourGardeners.java

For part c: Call the main program for part c EightGardeners.java

For part d: Create a ThreadedGardenRobot class and a main program called ThreadedGardeners.java
     Use 4 robots for this solution.

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 #4 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.