Time class
Version 1.4

DOCUMENTATION


NEW IN THIS VERSION: The class now has operators -, >> and << instead of the methods minus, read and print (for more natural user code).  


Each Time object represents a time on a 24-hour clock (0:00 to 23:59).

Constructors:

    Time()    
    Time(int h) 
    Time(int h, int m) 
        Initializes the time to either 99:99 (an invalid value), h:00 or h:m.

Methods:
    
    int hours() const 
    int minutes() const 
        Returns the hours or minutes of the time.
    
    void set_hours(int new_hours)   
    void set_minutes(int new_minutes) 
        Sets the hours or minutes of the time.
        
    void set(int new_hours, int new_minutes = 0)
        Sets the hours and minutes of the time.

Standalone functions:

    istream & operator>>(istream & in, Time & t)
        Reads t from in the format h:mm or hh:mm, where each h and m stands for a single digit.  Returns in.  No error-checking.
        
    ostream & operator<<(ostream & out, const Time & t)
        Prints t to out in the format described for read.  Returns out. 

    double operator-(const Time & t1, const Time & t2)
        Computes the difference, in hours, between t1 and t2.  The difference is positive if t1 occurs after t2.  In other words, the difference is computed as "t1 - t2".
        
Implementation notes: Each time is stored as a pair of integers (hours, minutes) by using a class.  The data is private.  

