class dateType
public:
void setDate(int month, int day, int year);
//Function to set the date. //The member variables dMonth, dDay, and dyear are set //according to the parameters. I/Postcondition: dMonth = month; dDay = day; dYear = year
int getDay() const;
//Function to return the day. //Postcondition: The value of dDay is returned.
int getMonth() const;
//Function to return the month. //Postcondition: The value of dMonth is returned.
int getYear() const;
//Function to return the year. //Postcondition: The value of dYear is returned.
void printDate() const;
//Function to output the date in the form mm-dd-yyyy.
dateType (int month = 1, int day = 1, int year = 1900);
//Constructor to set the date //The member variables dMonth, dDay, and dYear are set //according to the parameters. //Postcondition: dMonth = month; dDay = day; dYear = year. If // no values are specified, the default values are used to // initialize the member variables.
private:
int Month; //variable to store the month int dDay; //variable to store the day int dYear; //variable to store the year
};
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 1 | 2 | 3 | 4 | 5 |