-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathemployee inharitance.cpp
59 lines (56 loc) · 1.01 KB
/
employee inharitance.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
#include<iostream>
#include<string.h>
using namespace std;
class employee
{
private:
int id;
string name;
double salary;
public:
employee()
{
id=0;
name=" ";
salary=0;
}
employee(int i,string n, double d)
{
id=i;
name=n;
salary=d;
}
void set_id(int i)
{
id=i;
}
void set_name(string n)
{
name=n;
}
void set_salary(double d)
{
salary=d;
}
void print_info()
{
cout<<"ID: "<<id<<endl;
cout<<"Name: "<<name<<endl;
cout<<"salary: "<<salary<<endl<<endl;
}
};
int main()
{
employee s1(18334455,"A Karim",15000.00);
employee s2(18111122,"A Rahman",20000.00);
employee s3;
s3.set_id(124578);
s3.set_name("assad");
s3.set_salary(12000.00);
employee employe_list[10];
employee merit_list[5];
s1.print_info();
s2.print_info();
s3.print_info();
return 0;
}