-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathemployeeClass.cpp
More file actions
43 lines (32 loc) · 1.06 KB
/
employeeClass.cpp
File metadata and controls
43 lines (32 loc) · 1.06 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
#include<iostream>
#include<string>
#include<math.h>
using namespace std;
class Employee{
private:
string name;
int years;
int basic;
public:
void employeeSetter(string employee_name, int input_years, int input_basic){
name = employee_name;
years = input_years;
basic = input_basic;
cout<<"Inputs are recorded ";
cout<<name<<" "<<years<<" "<<basic<<endl;
}
float appraisal(float percentage){
return basic*(pow((1 + (percentage/100)), years)) - basic*(pow((1 + (percentage/100)), (years-1)));
}
};
int main(){
Employee gago;
string name;
int years;
int basic;
cout<<"Enter the details of the Employee, in the order NAME first, then his/her EXPERIENCE at the organisation, followed by his/her STARTING SALARY "<<endl;
cin>>name>>years>>basic;
gago.employeeSetter(name,years,basic);
cout<<endl;
cout<<name<<" has an increment of "<<gago.appraisal(10);
}