< previous page page_866 next page >

Page 866
#include bool.h

class TimeType
{
public:
    void Set( /* in */ int hours,
              /* in */ int minutes,
              /* in */ int seconds );
        // Precondition:
        //     0 <= hours <= 23 && 0 <= minutes <=
        //  && 0 <= seconds <= 59
        // Postcondition:
        //     Time is set according to the incoming parameters

    void Increment();
        // Postcondition:
        //     Time has been advanced by one second, with
        //     23:59:59 wrapping around to 0:0:0

    void Write() const;
        // Postcondition:
        //     Time has been output in the form HH:MM:SS

    Boolean Equal( /* in */ TimeType otherTime ) const;
        // Postcondition:
        //     Function value == TRUE, if this time equals otherTime
        //                    == FALSE, otherwise

    Boolean LessThan( /* in */ TimeType otherTime ) const;
        // Precondition:
        //     This time and otherTime represent times in the
        //     same day
        // Postcondition:
        //     Function value == TRUE, if this time is earlier
        //                             in the day than otherTime
        //                    == FALSE, otherwise

    TimeType( /* in */ int initHrs,
              /* in */ int initMins,
              /* in */ int initSecs );
        // Precondition:
        //     0 <= initHrs <= 23 && 0 <= initMins <= 59
        //  && 0 <= initSecs <= 59
        // Postcondition:
        //     Class object is constructed
        //  && Time is set according to the incoming parameters

    TimeType();
        // Postcondition:
        //     Class object is constructed && Time is 0:0:0

 
< previous page page_866 next page >