-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmanager.h
More file actions
93 lines (75 loc) · 1.93 KB
/
manager.h
File metadata and controls
93 lines (75 loc) · 1.93 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#include "enumerations.h"
#include "people.h"
#include <iostream>
#include <string.h>
#include "juniorPartnerEmployees.h"
#include "client.h"
using namespace std;
#ifndef MANAGER_H_
#define MANAGER_H_
class Manager:public juniorPartnerEmployee {
public:
Manager();
Manager(string first, string last, int age);
~Manager() { }
int getJuniorPartnerId() const;
void setHasBeenHired(bool state);
bool getHasBeenHired() const;
bool agreeToClose(bool hasLoan) const;
bool agreeForLoan(Client& client, int loanAmount);
string getHiredGroupName() const;
Role_t getThisRole() const;
private:
int juniorPartnerId;
bool hasBeenHired = false;
};
Manager::Manager() {
this->firstName = "";
this->lastName = "";
this->age = 18;
this->role=MNGR;
this->juniorPartnerId = 0;
this->netWorth = 0;
this->hiredGroupName = "";
this->hasBeenHired = false;
}
Manager::Manager(string first, string last, int age) {
this->firstName = first;
this->lastName = last;
this->age=age;
this->role=MNGR;
this->juniorPartnerId = 0;
this->netWorth = 0;
this->hiredGroupName = "";
this->hasBeenHired = false;
}
int Manager::getJuniorPartnerId() const {
return this->juniorPartnerId;
}
bool Manager::getHasBeenHired() const {
return this->hasBeenHired;
}
void Manager::setHasBeenHired(bool state) {
this->hasBeenHired = state;
}
bool Manager::agreeToClose(bool hasLoan) const {
if(hasLoan) return false;
else return true;
}
bool Manager::agreeForLoan(Client &client, int loanAmount) {
if( client.getNetWorth() >= (0.25 * loanAmount) ) {
cout << "Loan can be granted." << endl;
return 1;
}
else {
cout << "Loan cannot be granted!" << endl;
return 0;
}
}
string Manager::getHiredGroupName() const {
return this->hiredGroupName;
}
Role_t Manager::getThisRole() const {
return this->role;
}
#endif //MANAGER_H_