-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHottub.hpp
More file actions
31 lines (27 loc) · 701 Bytes
/
Hottub.hpp
File metadata and controls
31 lines (27 loc) · 701 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
29
30
31
#ifndef HOTTUB_H
#define HOTTUB_H
#include <iostream>
class Hottub {
public:
void on() { on_state = true; }
void off() { on_state = false; }
void circulate() {
if (on_state) std::cout << "Hottub is bubbling\n"; }
void jetsOn() { std::cout << "Hottub jets are On\n"; }
void jetsOff() { std::cout << "Hottub jets are Off\n"; }
void setTemperature(const int &temp);
private:
bool on_state;
int temperature;
};
inline
void
Hottub::setTemperature(const int &temp)
{
if (temp > temperature)
std::cout << "Hottub is heating to a steaming " << temp << " degrees\n";
else
std::cout << "Hottub is cooling to " << temp << " degrees\n";
temperature = temp;
}
#endif /* HOTTUB_H */