📄 time.h
字号:
// Tutorial 15: Time.h
// Declaration of class Time.
// Member functions are defined in Time.cpp
// prevent multiple inclusions of header file
#ifndef TIME_H
#define TIME_H
// Time abstract data type definition
class Time
{
public:
Time(); // default constructor
Time( int, int, int ); // three-argument constructor
void displayTime(); // displays the formatted time
void tick(); // increments the time by one second
// get functions
int getHour(); // gets the current hour
int getMinute(); // gets the current minute
int getSecond(); // gets the current second
// set functions
void setHour( int ); // sets the hour
void setMinute( int ); // sets the minute
void setSecond( int ); // sets the second
private:
int hour; // stores the hour (range: 1 - 12)
int minute; // stores the minute (range: 0 - 59)
int second; // stores the second (range: 0 - 59)
}; // end class Time
#endif
/**************************************************************************
* (C) Copyright 1992-2005 by Deitel & Associates, Inc. and *
* Pearson Education, Inc. All Rights Reserved. *
* DISCLAIMER: The authors and publisher of this book have used their *
* best efforts in preparing the book. These efforts include the *
* development, research, and testing of the theories and programs *
* to determine their effectiveness. The authors and publisher make *
* no warranty of any kind, expressed or implied, with regard to these *
* programs or to the documentation contained in these books. The authors *
* and publisher shall not be liable in any event for incidental or *
* consequential damages in connection with, or arising out of, the *
* furnishing, performance, or use of these programs. *
**************************************************************************/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -