//******************************************************************
// SPECIFICATION FILE (datetype.h)
// This file gives the specification of a DateType abstract data
// type and provides an enumeration type for comparing dates
//******************************************************************

enum RelationType {BEFORE, SAME, AFTER};

class DateType
{
public:
    void Set( /* in */ int newMonth,
              /* in */ int newDay,
              /* in */ int newYear  );
        // Precondition:
        //     1 <= newMonth <= 12
        //  && 1 <= newDay <= maximum no. of days in month newMonth
        //  && newYear > 1582
        // Postcondition:
        //     Date is set according to the incoming parameters

    int Month() const;
        // Postcondition:
        //     Function value == this date's month

    int Day() const;
        // Postcondition:
        //     Function value == this date's day

    int Year() const;
        // Postcondition:
        //     Function value == this date's year

    void Print() const;
        // Postcondition:
        //     Date has been output in the form
        //        month day, year
        //     where the name of the month is printed as a string

    RelationType ComparedTo( /* in */ DateType otherDate ) const;
        // Postcondition:
        //     Function value == BEFORE, if this date is
        //                               before otherDate
        //                    == SAME, if this date equals otherDate
        //                    == AFTER, if this date is
        //                              after otherDate

    void Increment();
        // Postcondition:
        //     Date has been advanced by one day

    DateType();
        // Postcondition:
        //     New DateType object is constructed with a
        //     month, day, and year of 1, 1, and 1583
private:
    int mo;
    int day;
    int yr;
};
