-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path8.1.cpp
76 lines (70 loc) · 1.22 KB
/
8.1.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
70
71
72
73
74
75
76
#include <iostream>
using namespace std;
class publication
{
public:
string title;
float price;
void getdata()
{
string t;
float p;
cout << "\nenter the titel::";
cin >> t;
cout << "enter the price::";
cin >> p;
title = t;
price = p;
}
void putdata()
{
cout << "title:-" << title << endl;
cout << "price:-" << price << endl;
}
};
class book : public publication
{
public:
int page_count;
void getdata1()
{
getdata();
int pc;
cout << "enter page count::";
cin >> pc;
page_count = pc;
}
void putdata1()
{
putdata();
cout << "page count:-" << page_count << endl;
}
};
class tape : public publication
{
public:
float play_time;
void getdata2()
{
getdata();
float pt;
cout << "playing time::";
cin >> pt;
play_time = pt;
}
void putdata2()
{
putdata();
cout << "play_time:-" << play_time << endl;
}
};
int main(int argc, char const *argv[])
{
book raj;
tape babu;
raj.getdata1();
babu.getdata2();
raj.putdata1();
babu.putdata2();
return 0;
}