Question
Do not include string stream. Easy as Possible and Explained! Write the class definition for a Clock Time class that contains hours, minutes and meridian
Do not include string stream. Easy as Possible and Explained!
Write the class definition for a Clock Time class that contains hours, minutes and meridian (AM or PM). Hours are to be stored in military time (a 24 hour clock using 0 23). The Clock Time constructor requires both hour and minutes and based on the hour, calculates the meridian. The constructor must also verify that hours and minutes are within range and defaults to maximum values if they are incorrect. Add a member function that displays the Clock Time object in the HH:MM AM format based on a 12-hour clock. For example, if the actual time were 17:30, the display would read 5:30 PM.
You program will use the following non-member function:
void assert That(Clock Time t, string expected)
{
if (t.display() == expected)
{
cout\"test>
}
else
{
cout\"test>
}
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started