< previous page page_856 next page >

Page 856
{
    if (hrs < 10)
        cout << 0;
    cout << hrs < :;
    if (mins < 10)
        cout << 0;
    cout << mins < :;
    if (secs < 10)
        cout << 0;
    cout << secs;
}

//******************************************************************

Boolean TimeType::Equal ( /* in */ TimeType otherTime ) const

// Precondition:
//     The Set function has been invoked at least once
//     for both this time and otherTime
// Postcondition:
//     Function value == TRUE, if this time equals otherTime
//                    == FALSE, otherwise

{
    return (hrs == otherTime.hrs && mins == otherTime.mins &&
            secs == otherTime.secs);
}

//******************************************************************

Boolean TimeType::LessThan( /* in */ TimeType otherTime ) const

// Precondition:
//     The Set function has been invoked at least once
//     for both this time and otherTime
//  && 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

{
    return (hrs < otherTime.hrs ||
            hrs == otherTime.hrs && mins < otherTime.mins ||
            hrs == otherTime.hrs && mins == otherTime.mins
                                 && secs < otherTime.secs);
}

 
< previous page page_856 next page >