Part 2 |
Now define criteria for determining where each color should go. The simplest criterion is based on the sum of the three color components. If the sum of the component numbers is less than 230, decide it is dark, if it is greater than 600, decide it is white. Otherwise it is colored. After you get the program working you might want to experiment with other criteria.
We will let you figure out most of the details of how to add the features for the more advanced versions. One piece of advice is that for the second enhancement you will be dropping the onMouseClick method in favor of using the three methods:
Value | Feature |
Style, Design, and Efficiency (10 pts total) | |
2 pts. | Descriptive comments |
2 pts. | Good variable names |
2 pts. | Good use of constants |
2 pts. | Appropriate formatting |
1 pt. | Does not generate new objects unnecessarily |
1 pt. | Design issues |
Correctness (10 pts total) | |
2 pts. | Generates a new color swatch only if previous one placed correctly |
2 pts. | Swatch displayed in the correct initial position; returns to original location if incorrectly sorted |
2 pts. | Updates number correct and incorrect properly |
2 pts. | Drags swatch properly (-1 pt if can use clicking instead of dragging |
2 pts. | Appropriate behavior if user does unexpected things like starting to drag outside the swatch |
Extra credit (1 pt) | |
1 pt. | Does not update either # correct or # incorrect if user misses all baskets |
If you should accidentally turn in a bad version of your program, you may drag another copy in as long as you change the name to be slightly different from the one you used before (e.g. Jane Doe - lab 2a). The new name should make it clear which is the newer version.
Good luck and have fun!
Computer Science
051
Department of Math & Computer Science
Pomona College
Part 2 |