Need Help With "TimeCard" Program

I'm not really all that good at C++ yet. I was actually trying to program this is batch but decided that C++ would probably be a better language for this task. I am trying to build a "TimeCard" program that you can type in the hours you worked and it exports your total hours to a .txt file. I've gotten this done so far, but I'm still kinda stuck:

#include <cstdlib>
#include <iostream>

using namespace std;

int main(int argc, char *argv[])
{
    int hours, minutes;
    int final;
    
    gettime:
    cout << "ENTER HOURS: ";
    cin >> hours;
    cout << "ENTER MINUTES: ";
    cin >> minutes;
    
    if ( hours == 1 || hours == 2 || hours == 3 || hours == 4 || hours == 5 || hours == 6 ) {
         hours = hours + 12;
         }
    if ( minutes > 60 ) {
         cout << "INVALID MINUTES" << endl << endl;
         goto gettime;
         }
    if ( hours > 12 ) {
         cout << "INVALID HOURS" << endl << endl;
         goto gettime;
         }
    else {
         goto final;
         }
    
    final:
    hours = hours * 60;
    hours = hours + minutes;
    final = hours;
    goto gettime;
    
    
    
    system("PAUSE");
    return EXIT_SUCCESS;
}



I know I need to collect the hours again and then subtract the first "final" from the second "final", then divide that all by 60 to get the total hours. But I also need to take into consideration that there is a lunch break also, and we tally up all the time at the end of two weeks. So I will have to enter two weeks worth of time. If someone could help me out that would be awesome.
put everthing between gettime: and goto gettime; in its own function (that returns the minutes) and call these function twice for the calculation.
that still doesn't solve the problem that I have no output of how many hours were worked though.
Topic archived. No new replies allowed.