Please help me out with Subactivity 4.a.1.
#include <iostream>
using namespace std;
int main()
{
int hours1, hours2, mins1, mins2, totalHours, totalMins;
cout << "Enter the time in hours and minutes: ";
cin >> hours1 >> mins1;
cout << "Enter another time in hours and minutes: ";
totalHours = hours1 + hours2;
totalMins = mins1 + mins2;
cin >> hours2 >> mins2;
cout << "The total time is " << totalHours << " hours and " << mins1 +
mins2 << " minutes" << endl;
return 0;
}
the programme compiles but when i run it, it gives me a wrong number of hours(4000869). The minutes are calculated correctly but the hours just don't want to.
Please help since i need to finish this before tuesday so that i can submitt my assignment( Due on 30 March)
please email me on
m26435@yahoo.co.uk or
n290988m@gmail.com
or send me an sms on 078 415 5547.
Later