/******************************************************************************************** example 10 -- clocktime.h using a single member data to handle all three fields ********************************************************************************************/ #include <iostream> using namespace std; //class definition class clocktime { private: int second; // 0-???? static bool AMPM; public: clocktime(const int h=0, const int m=0, const int s=0); //constructor with inits void print(ostream& out = cout) const; const int getHour() const; const int getMin() const; const int getSec() const; void addHour(const int h); void addMinute(const int m); void addSecond(const int s); void addSame(const clocktime& mt); clocktime operator+(const clocktime& mt) const; friend ostream& operator<<(ostream& out, const clocktime& mt); void show24H(const bool& set = true); void showAMPM(const bool& set = true); };