|
|
Since Stopwatch(3C++) behaves very much like a real stopwatch, we will explain its behavior by analogy. To avoid confusion, we will use an upper-case `S' when writing about software Stopwatches, and a lower-case `s' when writing about real stopwatches.
The kind of stopwatch we are thinking of has three buttons, three displays, and a status light. The status light is on while the Stopwatch is running and off while it is not running. The buttons are marked START, STOP, and RESET and the displays are marked SYSTEM, USER, and REAL. Pressing the START button has an effect on the status light and displays that depends on the state in which the button is pressed. We'll continue this analogy in the following sections, which divide Stopwatch operations into four groups for ease of presentation: (1) Constructors (2) Status operation (3) Setting operations (4) Reading operations.