forked from matkatmusic/PFMCPP_Project5
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLiveRoom.cpp
More file actions
68 lines (58 loc) · 1.73 KB
/
Copy pathLiveRoom.cpp
File metadata and controls
68 lines (58 loc) · 1.73 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#include <iostream>
#include "LiveRoom.h"
LiveRoom::LiveRoom()
{
std::cout << "LiveRoom being constructed." << std::endl;
}
LiveRoom::~LiveRoom()
{
std::cout << "LiveRoom being deconstructed." << std::endl;
}
LiveRoom::Musician::Musician() : name("John"), mainInstrument("Piano"), yearsExperience(10), hourlyRate(75)
{
std::cout << "Musician being constructed." << std::endl;
}
LiveRoom::Musician::~Musician()
{
std::cout << "Musician being deconstructed." << std::endl;
}
void LiveRoom::aboutLiveRoom() const
{
std::cout << "This live room is called " << this->name << std::endl;
}
int LiveRoom::calculateMusicianFee(int hours, bool receivesPublishingPercentage) const
{
int musicianFee = 0;
for (int i = 0; i <= hours; ++i)
{
if(receivesPublishingPercentage == true)
{
musicianFee += 45; // no overtime fee
}
else
{
musicianFee += 115;
if(i % 10 == 0)
{
musicianFee += 30; // overtime fee
}
}
}
std::cout << "He is charging $" << musicianFee << " for this session." << std::endl;
return musicianFee;
}
void LiveRoom::seatMusician(Musician musicianName, std::string thisName) const
{
musicianName.name = thisName;
std::cout << "Today we're enjoying the dulcet tones of " << musicianName.name << std::endl;
}
bool LiveRoom::switchLights()
{
lightsCurrentState = !lightsCurrentState;
std::cout << "The lights are currently " << (lightsCurrentState ? "on." : "off.") << std::endl;
return lightsCurrentState;
}
void LiveRoom::Musician::aboutMusician() const
{
std::cout << "This musician is named " << this->name << std::endl;
}