logistic_guy
Senior Member
- Joined
- Apr 17, 2024
- Messages
- 1,072
Modify class \(\displaystyle \text{Time2}\) of Fig. \(\displaystyle 8.5\) to include a tick method that increments the time stored in a \(\displaystyle \text{Time2}\) object by one second. Provide method incrementMinute to increment the minute by one and method incrementHour to increment the hour by one. Write a program that tests the tick method, the incrementMinute method and the incrementHour method to ensure that they work correctly. Be sure to test the following cases:
\(\displaystyle \bold{a)}\) incrementing into the next minute,
\(\displaystyle \bold{b)}\) incrementing into the next hour and
\(\displaystyle \bold{c)}\) incrementing into the next day (i.e., \(\displaystyle 11:59:59 \ \text{PM}\) to \(\displaystyle 12:00:00 \ \text{AM}).\)
\(\displaystyle \bold{a)}\) incrementing into the next minute,
\(\displaystyle \bold{b)}\) incrementing into the next hour and
\(\displaystyle \bold{c)}\) incrementing into the next day (i.e., \(\displaystyle 11:59:59 \ \text{PM}\) to \(\displaystyle 12:00:00 \ \text{AM}).\)