Input a time specified as the hour(1-12), minute (0-59), and the meridian (A or P for A.M or P.M); then output that time in the form HH:MM A.M/P.M.
Then enter a nonnegative number of minutes and output the time that is that number of minutes later than the original time. A sample run would look like:
Enter hours, minutes, and (A)m or (P)m: 10 5 p
The time is 10:05 PM
Enter a number of minutes (>0): 200
After 200 minutes, the time will be 1.25 AM
OK, here is what i came up with so far:
There are 3 numbers that have to be input, so entering a number, could be 1 function. convert minutes to hours and minutes, that could be a second function. first thing is to get the info.convert the minutes (to be added) to hours(newhours) and minutes(newminutes) using division by 60 and modular division by 60.and newhours to original HH, add newminutes to MM.
If the results are > 60 add 1 to the hour and subtract 60 from the minutes.
Can someone please help me to put this into coding. Thank you.