#ifndef DATEH #define DATEH #include #include using namespace std; class date { int year; //Must construct data members in this order. int month; //date::january to date::december inclusive int day; //1 to length[month] inclusive void install(int m, int d, int y); public: enum month_t { //indices into the length array january = 1, february, march, april, may, june, july, august, september, october, november, december }; date(int initial_month, int initial_day, int initial_year) { install(initial_month, initial_day, initial_year); } date(); virtual ~date() {} int get_month() const {return month;} int get_day() const {return day;} int get_year() const {return year;} virtual int length() const; date& operator++(); date& operator--(); friend ostream& operator<<(ostream& o, const date& d) { return o << d.month << "/" << d.day << "/" << d.year; } }; #endif