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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started