I am told to write a program for a clock that has the user input a time with AM or PM and the user will then input an integer value to move the clock forward x amount of minutes. The first example works on my code but the second one does not. Any help on identifying the issue is greatly appreciated!
Example 1
Enter the current time:
11 23 A
How many minutes forward do you want to move the clock?
39
New time: 12:2 PM
Example 2
Enter the current time:
12 34 A
How many minutes forward do you want to move the clock?
9999
New time: 11:13 PM
PLEASE ALWAYS USE CODE TAGS (the <> formatting button) when posting code.
It makes it easier to read your code and also easier to respond to your post. http://www.cplusplus.com/articles/jEywvCM9/ http://www.cplusplus.com/articles/z13hAqkS/
Hint: You can edit your post, highlight your code and press the <> formatting button.
You can use the preview button at the bottom to see how it looks.
One error I did fine in that you are missing the ";" at the end of line 16.
I will have to run the program to see what it is doing.
thanks for looking at this eyesore! I fixed it out of principal on the forum but I've already fixed the actual problem after an hour or so of torture haha.