Question: FOR C++ Write a program that determines the difference between two times in 24h00 format. The program must ask the user to enter two times
FOR C++ Write a program that determines the difference between two times in 24h00 format. The program must ask the user to enter two times in 24h00 format, convert the two times to seconds, get the difference, and display the result in 24h00 format again. The 24h00 format time should be input as hh mm ss, and displayed as hh:mm:ss, e.g. 13 hours, 12 minutes and 34 seconds will be input as 13 12 34 and displayed as 13:12:34.
The program must check which time is the smaller time before subtracting the user may enter the times in any order. Verify that the times entered are legitimate times, using the assert macro, e.g. 23 65 01 is not a valid time.
NB: Note that you are expected to use the assert macro in this question.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
