C++ time project

Im having a hard time with this can somebody please help me!!?!!

Code and test a class for the time. The name of the class should be MyTime.

It should consist of two private properties:
1. iHour - an integer specifying the hour on a 24-hour clock
2. iMinutes - an integer specifying the minutes

It should contain the following public methods:
1. a getHour method returning the hour as an integer
2. a getMinute method returning the minute as an integer
3. a setHour method with one integer parameter (hour on a 24-hour clock) --- Valid hours are 0–24. Both 0 and 24 represent midnight, but should be stored as 0. If valid, assign the parameter to the property and return a bool of true. If invalid, assign a default of zero to the property and return a bool of false.
4. a setMinute method with one integer parameter (minute) --- Valid minutes are 0 – 59. If valid, assign the parameter to the property and return a bool of true. If invalid, assign a default of zero to the property and return a bool of false.
5. a setTime method with two integer parameters (hour, minute) on a 24-hour clock --- If valid as described above, assign the parameters to the properties and return a bool of true. If the hour and/or minute parameters are invalid, default both properties to zeros and return a bool of false.

The get methods should be inline. All other methods should be non-inline.

Code a mainline to test the class. You will test with my main( ) after you have tested with your main. Separate your code into three files:
1. MyTime.h file containing the class definition
2. MyTime.cpp file containing the non-inline member functions
(This file must include the header.)
3. Lab3.cpp containing your main.
(This file must include the header.)
If you include all three files in the project folder, it is not necessary to specify full paths.
Topic archived. No new replies allowed.