Question
1. Write a C++ program that takes two different train departure times (where 0 is midnight,0700 is 7:00 a.m., 1314 is 14 minutes oast 1:00
1. Write a C++ program that takes two different train departure times (where 0 is midnight,0700 is 7:00 a.m., 1314 is 14 minutes oast 1:00 p.m., and 2200 is 10 p.m) and prints the difference between the two times in hours and minutes. Assume both times are on the same date and that both times are valid. For example,1099 is not a valid time because the last two digits are minutes which should be in the range of 00 through 59.2401 is not valid because the hours (the first two digits must be in the range of 0 through 23 inclusive. For example, if train A departs at:1255 and train B departs at:1305 the difference would be 0 hours and 10 minutes. One dialogue should look like this, but run your program several times for several test cases.
Train A departs at: 1285
Train B departs at:1305
Difference: 0 hours and 10 minutes
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