// File: Date.h // Definition of class Date #ifndef DATE_H #define DATE_H #include #include using namespace std; class Date { public: // Constructor Date(int m = 1,int d = 1,int y = 1900 ); // note default arguments // Copy Constructor Date(const Date &); // Sets void setMonth(int mm); void setDay(int dd); void setYear(int yy); // Gets int getMonth(); int getDay(); int getYear(); void setDate(int,int,int ); // set the date all at once void getDate(int &m,int &d,int &y); // get the entire date void increment(int days=1); // increment date bool leapYear(); // is the data's year a leap year? string getDateString(); private: int month; int day; int year; static const int days[]; // array of days per month // static since we need only one copy void helpIncrement(); // utility function bool endOfMonth(); // is this date at the end of month? }; bool leapYear(int y); // is y a leap year? #endif