-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUntitled5.cpp
55 lines (54 loc) · 1.09 KB
/
Untitled5.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
#include<iostream>
using namespace std;
class publication
{
public:
char pub[20];
void get()
{
cout<<"enter the publication name="<<endl;
cin>>pub;
}
};
class book: public publication
{
public:
char aut[20];
char title[20];
int cost;
void get()
{
cout<<"enter the title of the publication="<<endl;
cin>>title;
cout<<"enter the author name="<<endl;
cin>>aut;
cout<<"enter the cost of the object"<<endl;
cin>>cost;
}
};
class sale
{
public:
int sold;
void get()
{
cout<<"how many copies has been sold="<<endl;
cin>>sold;
}
};
class author: public book,public sale
{
public:
void d()
{
cout<<"the publication name is="<<pub<<endl<<"title of the book is: "<<title<<endl<<"books author is:-"<<aut<<endl<<"total no. of books sold are="<<sold<<endl<<"the cost of the book is"<<cost;
};
};
int main()
{
author obj;
obj.publication::get();
obj.book::get();
obj.sale::get();
obj.d();
}