-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathques7_manager.h
More file actions
67 lines (52 loc) · 1.77 KB
/
ques7_manager.h
File metadata and controls
67 lines (52 loc) · 1.77 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
using namespace std;
#ifndef ques7_manager.h
#define ques7_manager.h
#include "ques7.h"
#include <string>
#include <iostream>
#include <cstdlib>
class Manager : public Employee
{
public:
//function to display salary details
void Display();
//function to get entertainment allowance amount
double getAllowance();
//overridden function to calculate the tax
double calcTax(double grossPay, double deductions, double allowance, Employee employee);
//overridden function to calculate the gross pay
double calcGrossPay(Employee employee);
private:
//entertainment allowance
double Allowance;
};
//accessor for entertainment allowance
double Manager::getAllowance()
{
return Allowance;
}
//function to display salary details
void Manager::Display(Manager manager)
{
double salary = manager.getBasicSalary();
double manPension = manager.getPension();
double manMed = manager.getPension();
double manAllowance = manager.getAllowance();
cout<<"\nThe details of the manager's salary are the following: ";
cout"\nSalary: "<<salary;
cout<<"\nPension contribution of manager: "<<manPension;
cout<<"\nMedical aid contribution of manager: "<<manMed;
cout<<"\nEntertainment allowance: "<<manAllowance;
}
//function to calculate gross pay
double Employee::calcGrossPay(Manager manager)
{
//get the values
double theBasicSalary = manager.getBasicSalary();
double thePension = manager.getPension();
double theMed= manager.getMedicalAid();
double theAllowance = manager.getAllowance();
//calculate gross salary
double grossPay = theBasicSalary+thePension+theMed+theAllowance;
return grossPay;
}