- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlayer.cpp
More file actions
Latest commit
67 lines (56 loc) · 1.76 KB
/
Copy pathPlayer.cpp
File metadata and controls
67 lines (56 loc) · 1.76 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
/*
Author: Jil Dietz
*Date: 10/12/2021
*Email: jdietz@dmacc.edu
*Overview: This is a class that holds all the necessary player information so that that game can record,
* and return values that can be accumulated at the end of the game.
*/
#include<iostream>
#include<iomanip>
#include<string>
usingnamespacestd;
classPlayer{
private:
//declaring variables to generate
int kids = 0;
double money = 0.00;
string job, house, career;
bool marriage = false;
bool ownHouse = false;
double salary = 0.00;
int lifeCards = 0;
public:
Player (){};
voidsetJob(string job){this->job = job;}
voidsetHouse(string house) {this->house = house;}
voidsetSalary(double salary){this->salary = salary;}
voidsetCareer(string career){this->career = career;}
intgetKids(){return kids;}
doublegetMoney(){return money;}
string getJob(){return job;}
string getHouse(){return house;}
boolgetMarriage(){return marriage;}
boolgetOwnedHouse(){return ownHouse;}
doublegetSalary(){return salary;}
intgetLifeCards(){return lifeCards;}
string getCareer(){return career;}
voidaddKids(int numOfKids){ //adds children if needed
kids+=numOfKids;
}
voidaddLifeCards(){ //adds life cards to the total
lifeCards++;
}
voidaddIncome(){ //adds salary to the overall income
money += salary;
}
voidobtainHouse(){ //determines if the player has a house
ownHouse = true;
}
voidgetMarried(){ //changes the status of married to true
marriage = true;
}
doublemakePayment(double cost){ //removes cost from total amounth of money
money -= cost;
return money;
}
};