-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathEMPLOYEE detail.cpp
63 lines (51 loc) · 1.27 KB
/
EMPLOYEE detail.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
#include <iostream>
#include<conio.h>
using namespace std;
class employee
{
int emp_number;
char emp_name[20];
float emp_basic;
float emp_da;
float emp_it;
float emp_net_sal;
public:
void get_emp_details();
float find_net_salary(float basic, float da, float it);
void show_emp_details();
};
void employee :: get_emp_details()
{
cout<<"\nEnter employee number: ";
cin>>emp_number;
cout<<"\nEnter employee name: ";
cin>>emp_name;
cout<<"\nEnter employee basic: ";
cin>>emp_basic;
cout<<"\nEnter employee DA: ";
cin>>emp_da;
cout<<"\nEnter employee IT: ";
cin>>emp_it;
}
float employee :: find_net_salary(float basic, float da, float it)
{
return (basic+da)-it;
}
void employee :: show_emp_details()
{
cout<<"\n\n**** Details of Employee ****";
cout<<"\nEmployee Name : "<<emp_name;
cout<<"\nEmployee number : "<<emp_number;
cout<<"\nBasic salary : "<<emp_basic;
cout<<"\nEmployee DA : "<<emp_da;
cout<<"\nIncome Tax : "<<emp_it;
cout<<"\nNet Salary : "<<find_net_salary(emp_basic, emp_da, emp_it);
cout<<"\n-------------------------------\n\n";
}
int main()
{
employee emp;
emp.get_emp_details();
emp.show_emp_details();
return 0;
}