-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathManager.cpp
73 lines (57 loc) · 2.55 KB
/
Manager.cpp
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
#include "Manager.h" // class implemented
#include<string>
using namespace std;
// File scope starts here
/////////////////////////////// PUBLIC ///////////////////////////////////////
//============================= LIFECYCLE ====================================
// Manager Default + Overloaded Constructor
Manager::Manager(const string& aName, const string& aNIC, const Date& aDateOfBirth, const Date& aDateOfHire, const Address& aHomeAddress, double aTaxRate, double aBasicSalary, const string& aDepartment) : SalariedEmp(aName, aNIC, aDateOfBirth, aDateOfHire, aHomeAddress, aTaxRate, aBasicSalary), mDepartment(aDepartment) {
// base class initilzation using member initlizer list
this->SetManager(0,aDepartment);
}
// end Manager constructor
//============================= OPERATIONS ===================================
// Overriding function that prints all the details of the Manager.
void Manager::PrintEmployee()const {
SalariedEmp::PrintEmployee();
cout << "Department: " << this->GetDepartment() << endl;
}
// end function PrintEmployee
//============================= ACESS ===================================
// function that sets department of Manager
void Manager::SetDepartment(const string& aDepartment) {
this->mDepartment = aDepartment;
}
// end function SetDepartment
// function that sets the Manager
void Manager::SetManager(const string& aName, const string& aNIC, const Address& aHomeAddress, double aTaxRate, double aBasicSalary, const string& aDepartment) {
this->SetSalariedEmp(aName, aNIC, aHomeAddress, aTaxRate, aBasicSalary);
this->SetManager(0,aDepartment);
}
// end function SetManager
// overloaded function that sets the Manager
void Manager::SetManager(const SalariedEmp& aSalariedEmp, const string& aDepartment) {
this->SetSalariedEmp(aSalariedEmp.GetSalariedEmp());
this->SetManager(0,aDepartment);
}
// end function SetManager
// overloaded function that sets the Manager
void Manager::SetManager(int aDummy, const string& aDepartment) {
this->SetDepartment(aDepartment);
}
// end function SetManager
// overloaded function that sets the Manager
void Manager::SetManager(const Manager& aManager) {
this->SetManager(aManager.GetSalariedEmp(), aManager.GetDepartment());
}
// end function SetManager
// function that gets department of Manager
const string& Manager::GetDepartment()const {
return this->mDepartment;
}
// end function GetSales
// function that gets the Manager
const Manager& Manager::GetManager()const {
return *this;
}
// end function GetManager