C++ Primer 15 Exercise
01 // tv.h #ifndef TV_H_ #define TV_H_ class Remote; class Tv { public: friend class Remote; enum {Off, On}; enum {MinVal, MaxVal = 20}; enum {Antenna, Cable}; enum {TV, DVD}; enum {NORMAL, CONVERSATION}; Tv(int s = Off, int mc = 125) : state(s), volume(5), maxchannel(mc), channel(2), mode(Cable), input(TV) {} void onoff() { state = (state == On) ? Off : On; } bool ison() const { return state ==..
2023. 2. 21.