Write a Java application that draws a pattern in the output window that is drawn
with a for loop, and is drawn in successive stages based on the
number of times the user has clicked on a button on screen. For an example
of how your program should work,
click here.
You should have
a for loop in the paintComponent method of MUPanel that will draw one
or more shapes, and will be executed howMany times. You will need some
combination of g.setColor, g.drawRect,
g.fillRect, g.drawOval,
g.fillOval, g.drawArc and/or g.fillArc method calls to draw
your assigned pattern. After the shapes are drawn inside the for loop,
the values of the variables over, down, width and/or
height may need to be changed, based on how your assigned pattern changes.
Each student in the class has a unique pattern to work on — you MUST use the pattern that has been assigned to you for this project.
Convert your
H:\CSC120\Java\PA5 folder into a .zip file named PA5.zip and submit it to the PA5 dropbox
in D2L.
| Evaluation Item | Possible points |
|---|---|
| CSC 120, PA 5, name, date, & description comments in MUPanel.java | 4 |
One private data member: an
Integer named numberOfReps or something similar. |
3 |
constructor sets numberOfReps to 1. |
4 |
for loop in the paintComponent method that draws
one or more shapes, and is executed numberOfReps times. |
5 |
| A combination of g. methods used to draw your assigned pattern. | 3 |
After shapes are drawn inside for loop, over,
down, width and/or height are
changed to make pattern change. |
5 |
One button causes numberOfReps to increase by one. Other
button causes numberOfReps to be reset to 1.
|
4 |
| Pattern is correctly drawn, and matches the pattern assigned to the student. | 8 |
| Organization and readability of the Java code, including appropriate indenting | 4 |
| Total Points ====> | 40 |