CS 140 - Homework 4 - Due Thursday Sep 25


In this program you are going to create a 1000 pixel wide by 700 pixel high picture and draw a ball (circle) with a diameter of 100 pixels moving across the picture from left to right. When the right edge of the ball "hits" the right edge of the picture it should move back to the left edge. When the left edge of the ball "hits" the left edge of the picture it should move to the middle. Then it should go up and then down the screen to the bottom. When its finished the ball should turn red.

To see how your program should work you can run my version by double clicking on My Computer and going to the folder T:/Harcourt/Fall2008/CS140/HW4 and then double click on the file run.bat.

Grading

  1. Your animation should look just like mine and adhere to the problem description above. If you want to "enhance" it then that's okay. What I mean is if yow want to make it do more than the description above then feel free.
  2. Make sure your class is named HW4 and that the file is named HW4.java.
  3. Turn in a printout of your program at the beginning of class on Thursday Nov 25.
  4. Save the HW4.java file to the T: drive in your student folder. Please do not e-mail me your file as an attachment any longer.
  5. Before yo uturn in your program make sure it is propwerly indented. You can do this easily in Dr.Java by going to Edit -> Select All and going to Edit -> Indent Lines(s)