#ifndef DATEH #define DATEH #include #include //for time and localtime 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 static const int length[]; virtual 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 date& operator++(); virtual date& operator--(); friend ostream& operator<<(ostream& o, const date& d) { return o << d.month << "/" << d.day << "/" << d.year; } }; #endif