Question: Write a program in C + + that will prompt user to enter the time in 1 2 - hour notation. Then program outputs the
Write a program in C that will prompt user to enter the time in hour
notation. Then program outputs the time in hour notation.
Your program must contain three Exception classes; InvalidHour, InvalidMinute
and InvalidSecond.
If user enters and invalid value for hour then program should throw and catch an
InvalidHour object. Do same for minutes and seconds.
A valid input for hour, minute and second in pm should display output
of :: hours.
An hour can only has a value from to otherwise it is invalid.
A minute can only has a value from to otherwise it is invalid.
A second can only has a value from to otherwise it is invalid.
And finally a string to designate am or pm
Test program to make sure it is working correctly
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
