This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Time.h

By: darearkin on Mar 16th, 2013  |  syntax: None  |  size: 0.84 KB  |  views: 4  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #ifndef TIME_H
  2. #define TIME_H
  3.  
  4. class Time
  5. {
  6. public:
  7. public:
  8.    Time( int = 0, int = 0, int = 0 ); // default constructor
  9.    ~Time(); //default destructor
  10.  
  11.    // set functions
  12.    void setTime( int, int, int ); // set hour, minute, second
  13.    void setHour( int ); // set hour (after validation)
  14.    void setMinute( int ); // set minute (after validation)
  15.    void setSecond( int ); // set second (after validation)
  16.  
  17.    // get functions
  18.    int getHour() const; // return hour
  19.    int getMinute() const; // return minute
  20.    int getSecond() const; // return second
  21.    void printUniversal() const; // output time in universal-time format
  22.    void printStandard() const; // output time in standard-time format
  23. private:
  24.    int hour; // 0 - 23 (24-hour clock format)
  25.    int minute; // 0 - 59
  26.    int second; // 0 - 59
  27. }; // end class Time
  28.  
  29. #endif
clone this paste RAW Paste Data