If anyone has the time to help me i need help with this code
If anyone has the time to help me, i need help with this code, i dont know how to start, Please Help.
In c++. you will be creating a Time class that can display time as a digital clock in both 12-hour mode and 24 -hour mode. Your class should have the following properties:
private integer field for seconds.
private integer field for minutes.
private integer field for hours.
private field for clock mode; that is, a variable to tells if the time will be displayed as a 12-hour clock or a 24-hour clock. private static constant string array field for time periods (am and pm).
Solution
You need to create a class for time that can create time objects. Assume that there is a clock and when you look at the time, consider that as one object that contains things like hour, minutes, seconds, period and mode.
To create a class, you just need to declare it with class ClassName{}
To create private fields, declare them inside the class inside private:
Refer to the code below.
Code
class Time{
private:
int seconds;
int minutes;
int hours;
bool mode;
static const string periods[2] = [\'am\', \'pm\'];
}
