I am stuck at the very last part. I really cant figure the syntax on how to add the numbers.
Code:
#include <iostream>
using namespace std;
#include <cstdlib>
#include <string>
void getHours (int);
void getMinutes (int);
void calcTotalTime (int);
bool isValidMinutes (Minutes Test);
bool isValidHours(Hours Test);
const int MAX_MINS = 59;
const int MAX_HOURS = 23;
const int MIN_MINS = 0;
const int MIN_HOURS = 0;
int main ()
{
int hours, minutes;
int addedHours, addedMinutes;
cout << "Enter the number of hours for the starting time: ";
cin >> hours;
cout << "Enter the number of minutes for the starting time: ";
cin >> minutes;
cout << "Enter the number of hours to be added to the starting time: ";
cin >> addedHours;
cout << "Enter the number of minutes to be added to the starting time: ";
cin >> addedMinutes;
getHours(hours);
getMinutes(minutes);
calcTotalTime (int);
cout << "\nThe total time is " << hours << " hours and "
<< minutes << " minutes." << endl;
return 0;
}
bool isValidMinutes (Minutes Test)
{
if ( Minutes < 0 || Minutes > 60)
cout << "Invalid number: \n" ;
else
return true
}
bool isValidHours(Hours Test)
{
if ( Hours < 0 || or Hours > 23)
cout << "Invalid number: \n" ;
else
return true
}
void getHours (int i)
{
cout << " Total number of hours: " << i <<endl;
}
void getMinutes (int x)
{
cout << " Total number of minutes: " << x << endl;
}
void calcTotalTime (int )
{