-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTV.hpp
More file actions
28 lines (24 loc) · 558 Bytes
/
TV.hpp
File metadata and controls
28 lines (24 loc) · 558 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#ifndef TV_H
#define TV_H
#include <iostream>
#include <string>
class TV {
public:
TV(const std::string &l) : location(l) { }
void on() { std::cout << location << " TV is on\n"; }
void off() { std::cout << location << " TV is off\n"; }
void setInputChannel();
void setVolume(int volume) {
std::cout << location << " TV volume is set to " << volume << '\n'; }
private:
std::string location;
int channel;
};
inline
void
TV::setInputChannel()
{
channel = 3;
std::cout << location << " TV channel is set for DVD\n";
}
#endif /* TV_H */