Need Halp,
In class doing a C++ midterm RIGHT NOW. I haven't shown up for the entire semester so i don't exactly know what's going on. I will be forever in this forum's debt if they do this for me. i will do anything. anything.
Write a class called Time. Time has the public functions addSeconds, addMinutes addHours, seconds, minutes, hours, show, and showAmPm. Time has the private member variables seconds, minutes and hours. Seconds, minutes and hours run on a 24-hour clock; which means after 24-hours the time goes back to zero. Time also overloads the operators +,- and <. At least one operator must be overloaded as a friend function. The class must have constructors that allow initialization with just seconds, or with seconds, minutes, and hours.
The functions do the following
1. addSeconds – accepts an integer and adds it to the seconds variable.
2. addMinutes – accepts an integer and adds it to the minutes variable.
3. addHours – accepts an integer and adds it to the hours variable.
4. seconds – accepts no parameters and returns seconds.
5. minutes – accepts no parameters and returns minutes.
6. hours – accepts no parameters and returns hours.
7. show – displays the seconds, minutes and hours variables in a format consistent with a 24-hour clock.
8. showAmPm – displays the seconds, minutes and hours variables in a format consistent with a 12-hour clock and whether the time is AM or PM
9. + accepts two Time objects and adds their seconds, minutes and hours variables and returns a Time object by overloading the + operator
10. - accepts two Time objects and subtracts their seconds, minutes and hours variables and returns a Time object by overloading the + operator
11. < compares two Time objects to determine which is earlier in a 24 hour day by overloading the < operator