-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathques7_application.cpp
More file actions
42 lines (30 loc) · 1.36 KB
/
ques7_application.cpp
File metadata and controls
42 lines (30 loc) · 1.36 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
#include <string>
#include <iostream>
#include <cstdlib>
#include "ques7.h"
using namespace std;
int main()
{
//implement class Employee
//instantiate an object of class Employee
Employee employee;
//have user enter details of the employee in question
cin>>employee;
//access the values of the object
double currentBasicSalary = employee.getBasicSalary();
double currentPension = employee.getPension();
double currentMedicalAid = employee.getMedicalAid();
float currentTaxPercentage = employee.getTaxPercentage();
//display the values of the object
cout <<"\n\nThe details of the employee are as follows: ";
cout << "\nBasic Salary: "<<currentBasicSalary;
cout <<"\nPension contributed by employee: "<<currentPension;
cout << "\nMedical aid amount contributed by employee: "<<currentMedicalAid;
cout <<"\nTax percentage applicable to employee: "<<currentTaxPercentage;
double currentGrossPay = employee.calcGrossPay(employee);
double currentDeductions = employee.calcDeductions(employee);
double currentTaxAmount = employee.calcTax(currentGrossPay, currentDeductions, employee);
double netSalary = currentGrossPay - currentTaxAmount - currentDeductions;
cout <<"\nNetSalary after medical aid, pension and tax has been paid: "<<netSalary;
return 0;
}