-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinherit3.cpp
69 lines (69 loc) · 1.47 KB
/
inherit3.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
64
65
66
67
68
69
#include<iostream>
using namespace std;
class publisher{
protected:
int to;
string name;
public:
void ip(){
cout<<"Enter The Name Of publisher";
cin>>name;
cout<<"Enter The turn over Of publisher";
cin>>to;
}
// void show(){
// cout<<"The name of student is :"<<name;
// cout<<"The Roll No. Of Student is :"<<roll;
// }
};
class branch:public publisher{
protected:
string city;
int employees;
public:
void get(){
cout<<"Enter city is";
cin>>city;
cout<<"Enter The number of employees";
cin>>employees;
// cout<<"Enter The Marks Of english";
// cin>>e;
}
// void calc(){
// total=m+s+e;
// percentage=total/3;
// }
// void op(){
// cout<<"The name of student is :"<<name;
// cout<<"The Roll No. Of Student is :"<<roll;
// cout<<"The Marks of maths is :"<<m;
// cout<<"The Marks of science is :"<<s;
// cout<<"The Marks of english is :"<<e;
// cout<<"The total marks is :"<<total;
// cout<<"The percentage is :"<<percentage;
// }
};
class author: public branch{
protected:
string aname;
public:
void input(){
cout<<"enter The name of author";
cin>>aname;
}
void output(){
cout<<"Publisher name is "<<name;
cout<<"TO Of pub is "<<to;
cout<<"city of pub is"<<city;
cout<<"number of employees is"<<employees;
cout<<"Author Name is"<<aname;
}
};
int main(){
author a1;
a1.ip();
a1.get();
a1.input();
a1.output();
return 0;
}