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 31 32 33 34 35 36 37 38 39 40 41
|
class Date {
private:
int monthValue;
int dayValue;
int yearValue;
static const int MONTHS = 13;
typedef enum {
EMPTY = 0,
JAN = 31,
FEB = 28,
MAR = 31,
APR = 30,
MAY = 31,
JUN = 30,
JUL = 31,
AUG = 31,
SEP = 30,
OCT = 31,
NOV = 30,
DEC = 31
};
int daysPerMonth[MONTHS];
bool IsLeap() const;
public:
Date();
Date(const int month,
const int day,
const int year);
// Initializes the daysPerMonth[] array to EMPTY, JAN, FEB etc.
// Validates the date and sets the object.
void SetDate(const int month, const int day, const int year);
// <Other class member functions...>
};
|