Advertisement
darearkin

Time.h

Mar 16th, 2013
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement