// alarmclock.h - header file for class AlarmClock (Nagler, pp. 327-8 // - derived from class Appliance) // cmc, 8/13/03 #ifndef ALARM_CLOCK_H #define ALARM_CLOCK_H #include "appliance.h" #include "time.h" class AlarmClock : virtual public Appliance { public: // implicit inline functions AlarmClock() { } AlarmClock(double cost, Time const &clockTime = defaultTime, Time const &alarmTime = defaultTime) : Appliance(cost), clockTime(clockTime), alarmTime(alarmTime) { } Time const &getClockTime() const { return clockTime; } Time const &getAlarmTime() const { return alarmTime; } // ... no more needed for this example private: Time clockTime, alarmTime; static Time defaultTime; }; #endif