Question: C++ Please provide 3 code files, Clock.h, Clock.cpp and a driver to test the code. Implement a class called Clock with fields hour, minute, second
C++
Please provide 3 code files, Clock.h, Clock.cpp and a driver to test the code.
Implement a class called Clock with fields hour, minute, second of type int and isMorning of type bool. Include a constructor to initialize the Clock along with appropriate getters and setters for the fields. The constructor should have default parameters values of 12,0,0 and true, respectively, for the parameters corresponding to hour, minute, second and isMorning. Also include a void method tick that advances the clock by one second. Of course the clock should eventually roll back around to to 12:00:00 AM. Finally, include a method print() that outputs the current time e.g. 12:34:56AM
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
