//****************************************************************** // SPECIFICATION FILE (date.h) // This file gives the specification of a Date abstract data // type representing a date and an associated message //****************************************************************** class Date { public: void Print() const; // Postcondition: // Date and message have been output in the form // month day, year message // where the name of the month is printed as a string void CopyFrom( /* in */ Date otherDate ); // Postcondition: // This date is a copy of otherDate, including // the message string Date( /* in */ int initMo, /* in */ int initDay, /* in */ int initYr, /* in */ const char* msgStr ); // Constructor // Precondition: // 1 <= initMo <= 12 // && 1 <= initDay <= maximum number of days in initMo // && 1582 < initYr // && msgStr is assigned // Postcondition: // New class object is constructed with a date of // initMo, initDay, initYr and a message string msgStr Date( const Date& otherDate ); // Copy-constructor // Postcondition: // New class object is constructed with date and // message string the same as otherDate's // Note: // This constructor is implicitly invoked whenever a // Date object is passed by value, is returned as a // function value, or is initialized by another // Date object in a declaration ~Date(); // Destructor // Postcondition: // Message string is destroyed private: int mo; int day; int yr; char* msg; };