CS 140 - Homework 3 Due Monday September 14
Create a new folder in your student folder on the T: drive named
HW3 and copy a Program.java
to the
HW3 folder.
To see how your homework should finally look run my version by
double clicking on My Computer and going to the folder
T:/Harcourt/Fall09/cs140/HW3
and then double
click on the file run.bat
.
-
Use a loop to draw 50 concentric circles. Make the biggest circle 500 pixels
wide and high. It should look like below.
-
Modify your loop above so it animates drawing the circles by
starting with the
outermost circle. Draw a new circle every tenth of a second.
Do all of this in a method named
drawCircles
-
Now animate erasing the circles from the inside out. The code is very similar to
above but think about how you would reverse the process. Do this in a method
named
eraseCircles
.
-
Now draw circles like we did initially but draw filled
circles and animate them starting with the outer circle. Start the outer
circle white and make each circle progressively darker. The final result
should look like below.
Do this in a method named
fadedCircles
.
-
Your
run
method should be fairly short and just call the three methods drawCircles
, eraseCircles
, and
fadedCircles
.