Question: - A program for a simple stopwatch that has a timer and a display is to be developed. The program for the stopwatch allows for

- A program for a simple stopwatch that has a timer and a display is to be developed. The program for the stopwatch allows for only two buttons: Start and Reset. If the stopwatch timer is stopped, pressing the Start button causes the timer to count up from its current time. If the timer is progressing, pressing the Start button causes the timer to stop at its current time. Whenever the Reset button is pressed, the timer is stopped and is set to 0. The time from the timer is always shown on the stopwatchs display.

a. Create a UML class diagram for the stopwatch based on the description above.

b. Determine whether each of the classes you defined is active or passive. Explain why you made each class to be passive or active.

c. Pick one of the classes in your class diagram. Explain an invariant for it and how the invariant could be enforced.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!