-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMultiple_P8.cpp
More file actions
62 lines (59 loc) · 1.04 KB
/
Multiple_P8.cpp
File metadata and controls
62 lines (59 loc) · 1.04 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
#include<iostream.h>
#include<conio.h>
class employee
{
public:
int eid;
char name[30];
char desig[30];
void getemp()
{
cout<<"\n Enter the employee ID :";
cin>>eid;
cout<<"\n Enter the employee name :";
cin>>name;
cout<<"\n Enter the designation :";
cin>>desig;
}
};
class salary
{
public:
float bp;
float pf;
float np;
void getsal()
{
cout<<"\n Enter the Basic Pay : ";
cin>>bp;
pf=bp*0.12;
np=bp-pf;
}
};
class detail:public employee,public salary
{
public:
void display()
{
cout<<"\n\nEmployee ID : "<<eid;
cout<<"\nEmployee Name : "<<name;
cout<<"\nDesignation : "<<desig;
cout<<"\nBasic Pay : "<<bp;
cout<<"\nProvident Fund: "<<pf;
cout<<"\nNet Pay : "<<np;
}
};
void main()
{
clrscr();
cout<<"\n\t MULTIPLE INHERITANCE";
cout<<"\n\t----------------------";
cout<<"\n\nEmployee Detail:";
cout<<"\n----------------";
detail d;
d.getemp(
);
d.getsal();
d.display();
getch();
}