Question: PRG-1. Create a class named Time that defines a point in time in terms of hours, minutes, and seconds and specifies AM or PM. Hours

 PRG-1. Create a class named Time that defines a point in

PRG-1. Create a class named Time that defines a point in time in terms of hours, minutes, and seconds and specifies AM or PM. Hours can be between 1 and 12, minutes can be between 1 and 59, and seconds can also be between 1 and 59. Also define an integer that can be 0 or 1 to represent AM or PM. Create a default constructor that sets the time to midnight. Overload the prefix ++ to add one second to the time (representing each tick of the clock). Overload the operator() to find the duration of time from midnight in seconds. Overload the operator += to add a duration of times (in seconds) to get a new point of time

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!