We are going to continue our problem-solving education and start working with graphics by writing a program that shows a pair of dice. When the user clicks on the panel, the dice are rolled. This will help us understand Java graphics and classes.
We will also get more practice using Eclipse to make our programming life easier.
This is where we will put all our classes for homework 09.
The PairOfDice class is the same class from homework 7.
GraphicalPairOfDice should have a method:
In Exercise 6.3 the void drawDie(Graphics g, int val, int x, int y) method you pass in the value for the die. In our GraphicalPairOfDice the drawDie method takes the die number, either 1 or 2. Use the value of die1 or die2 to draw the die.
Criterion | Excellent (100%) | Satisfactory (75%) | Borderline (50%) | Unsatisfactory (25%) | Poor (0) |
---|---|---|---|---|---|
Adherence to standards - 2 points Does it conform to standards in every detail? |
No errors. | Minor details of the assignment are violated, or poor choices are made where the assignment is unclear. | Significant details of the assignment or the underlying program intent are violated, but the program still fulfills essential functions. | Significant details of the assignment or the underlying program intent are violated, but the program still fulfills some essential functions. | Misses the point of the assignment. |
Breakdown (modular design) - 2 points Does it demonstrate good modular design? |
No errors. | 1-3 minor errors. | > 3 minor errors OR 1 major error. | 2 major errors | > 2 major error. |
Correctness of code - 4 points Does it work? Does it pass JUnit? |
Passes all tests. | Works for typical input, may fail for minor special cases. | Fails for typical input, for a minor reason. | Fails for typical input, for a major reason. | No. |
Documentation, and style - 2 points Is it clear and maintainable? Does it pass CheckStyle? |
No errors. | 1-3 minor errors. | > 3 minor errors OR 1 major error. | 2 major errors | > 2 major error. |
The assignment is due on Friday, November 5th at 11:55pm. You may turn it in early.
Conduct a personal review of your code before turning it in. Does your code follow the Java Coding Standard?
Test your code.
Export your ICS111-workspace project by choosing File -> Export. Name the zip file H09.zip.
Sign into Laulima, then navigate to the ICS111 site. In the left hand side of the site, there is an Assignments tab/link. Click on it and view all of the posted assignments. Select the assignment that you want to turn in and attach your H09.zip file and accept the honor pledge to submit the assignment.