try this
Code:
#include <iostream.h>
int main()
{
int hrs1, mns1, hrs2, mns2, hrs, mns;
double Hour_Pay, Brutto;
cout << "Key the time you start at work: (eg. 15 23): ";
cin >> hrs1 >> mns1;
cout << "Key the time you leave work: (eg. 18 59): ";
cin >> hrs2 >> mns2;
cout << "Key the hour's pay: ";
cin >> Hour_Pay;
cout << endl;
mns1 = mns1 + hrs1*60;
mns2 = mns2 + hrs2*60;
mns = abs(mns2 - mns1);
hrs = mns/60;
mns = mns % 60;
Brutto = Hour_Pay * hrs + ((double)mns)/60 * Hour_Pay;
cout << "You work " << hrs << " hours and " << mns << " minutes every day at work."
<< endl
<< "Your gross day's pay is " << Brutto << " dollars.";
return 0;
now there's a small thing here..
if someone starts at 23 30 and leaves at 00 30,
it thinks he/she worked for 23 hrs, but in reality, it is
only 1 hr.
I leave it to you to fix it
as you can see.. i made a lot of changes in your code..
you didn't even declare certain variables in the beginning..
good luck