Class Design I
Objectives:
This lesson involves modifying the design of the Dice class.


Adding state and behavior:
We want to modify the Dice class so that it more accurately implements the behavior of the Dice class from the first-day role play. Recall that the Dice class in the first-day role play kept count of the number of times it was rolled. Recall that there were two additional behaviors: numRolls which reported the number of times the Dice was rolled and reset which reset the counter for the number of rolls.


Exercise 1: Modify the Dice class to add these behaviors. This modification involves adding an instance variable as well as methods. Consider how the existing methods should be changed and make the changes. Modify the program DiceMain to exercise these new behaviors.

Exercise 2: Write a program to accept a target value from the user and repeatedly roll two dice until the target value is rolled. Use the new Dice behavior to report the number of rolls it required.