#include<iostream>
using namespace std;

class Time
{
  private:
    int hour;   // 0 - 23 (24-hour clock format)
    int minute; // 0 - 59
    int second; // 0 - 59
  public:
    Time( int h , int m , int s ){
      setTime( h, m, s );  
    }
    // set functions
    void setTime( int h, int m, int s){ // set time
      setHour( h );
      setMinute( m );
      setSecond( s );
    }
    void setHour( int h){ // set hour
      hour = ( h >= 0 && h < 24 ) ? h : 0;  
    }
    void setMinute( int m){ // set minute
      minute = ( m >= 0 && m < 60 ) ? m : 0; 
    }
    void setSecond( int s){ // set second
      second = ( s >= 0 && s < 60 ) ? s : 0;
    }
    // get functions (normally declared const)
    int getHour() const{ // return hour
      return hour;
    }       
    int getMinute() const{ // return minute   
      return minute; 
    }
    int getSecond() const{ // return seco
      return second;
    }
    // print functions (normally declared const)        
    void printTime() const{
      cout<<hour<<" : "<<minute<<" : "<<second<<endl;      
    }
};
main(){
  Time wakeUp( 6, 45, 0 ); // non-constant object
  const Time noon( 12, 0, 0 ); // constant object
                          // OBJECT      MEMBER FUNCTION
  //wakeUp.setHour( 18 );   // non-const   non-const
    noon.setHour( 12 );     // const       non-const

  //wakeUp.getHour();       // non-const   const
  //noon.getMinute();       // const       const
  noon.printTime();       // const       const

  wakeUp.printTime();     // const       const
  system("pause");     
}
