# Thread: [HELP] Code to Convert Army Time to Normal Time?

1. ## [HELP] Code to Convert Army Time to Normal Time?

Like the program asks for the number of minutes and hours and it converts that to normal time.

For example, if you put 23 hours then 14 minutes it then converts the time to 11:14.

2. Originally Posted by Kipper DeVera
Like the program asks for the number of minutes and hours and it converts that to normal time.

For example, if you put 23 hours then 14 minutes it then converts the time to 11:14.
This is, once again, not a restaurant.

You've got to cook your own meal. We can always help if something goes wrong, but you have to show the effort .

3. Oh okay sorry, sorry. Imma upload my first try.

4. Originally Posted by Kipper DeVera
Like the program asks for the number of minutes and hours and it converts that to normal time.

For example, if you put 23 hours then 14 minutes it then converts the time to 11:14.
Well, step 1 is to understand the problem. For instance, you do not. 11:14 is only part of the time denoted by 23:14. Are we in the am or pm? Honestly, is this even a real question, how hard is it? Did you notice any correlation betweem 23 and 11? How about 22 and 10?

5. Yep I do. But first I hafta figure out how to convert that to normal time, Dear god, I get it okay? I suck at programming. Okay now?

Code:
```#include <iostream>

using namespace std;

int main (){
int hour, minutes;

cout << "Please enter the number of hours: ";
cin >> hour;

cout << "Please enter the number of minutes: ";
cin >> minutes;

if (hour == 13)
cout << "1" << endl;
if (hour == 14)
cout << "2" << endl;
if (hour == 15)
cout << "3" << endl;
if (hour == 16)
cout << "4" << endl;
if (hour == 17)
cout << "5" << endl;
if (hour == 18)
cout << "6" << endl;
if (hour == 19)
cout << "7" << endl;
if (hour == 20)
cout << "8" << endl;
if (hour == 21)
cout << "9" << endl;
if (hour == 22)
cout << "10" << endl;
if (hour == 23)
cout << "11" << endl;
if (hour == 24)
cout << "12" << endl;

cout << "The time is " << hour << " : " << minutes << endl;

return 0;
}```

6. No, you don't seem to get it. Do you know how to add and subtract?

7. Hint. The answer is 12.

8. Uhh herpderp. Yes, yes I do.

9. Then use that number. And substraction.

10. Originally Posted by Kipper DeVera
Uhh herpderp. Yes, yes I do.
Good response, especially considering it appears everyone here but you knows how to do this.