First page Back Continue Last page Overview Graphics

Exercise

10:17:59

Write a class

clock for a digital clock.

It should implement the following methods:

set(hours, minutes, seconds = 9);

tick();

The method tick() should “tick” for a second, i.e. the time should be advanced by one second:

11:59:59 → 12:00:00