-
Notifications
You must be signed in to change notification settings - Fork 1
/
Inheretense.cpp
140 lines (133 loc) · 3.01 KB
/
Inheretense.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
#include<iostream>
#include<cstdlib>
#include<string.h>
using namespace std;
class Publiser
{
protected:
char *Pname,*Paddr,*Pnum;
public:
Publiser()
{
Pname = new char [20];
Paddr = new char [50];
Pnum = new char [12];
}
Publiser(char a[] ,char b[] , char c[])
{
Pname = new char [20];
Paddr = new char [50];
Pnum = new char [12];
strcpy(Pname,a);
strcpy(Paddr,b);
strcpy(Pnum,c) ;
}
void input()
{
cout << "\nPlease enter PUBLISHER name ::: ";
cin.getline(Pname,19,'\n');
cout << "\nPlease enter PUBLISHER ADDRESS ::: ";
cin.getline(Paddr,19,'\n');
cout << "\nPlease enter PUBLISHER MOBILE NUMBER ::: ";
cin.getline(Pnum,11,'\n');
system("clear");
}
void output()
{
cout << "\nName of book Publisher is ::: ";
cout << Pname << endl;
cout << "\nAddres of book Publisher is ::: ";
cout << Paddr << endl ;
cout << "\nMOBILE NUMBER of book Publisher is ::: +91 ";
cout << Pnum << endl;
}
};
class BOOK :public Publiser
{
protected:
char *Bname,*BAname,*Bprise;
public:
BOOK()
{
Bname = new char [20];
BAname = new char [50];
Bprise = new char [12];
}
BOOK(char a[] ,char b[] , char c[] , char d[] ,char e[] , char f[] ) : Publiser(a,b,c)
{
Bname = new char [20];
BAname = new char [50];
Bprise = new char [12];
strcpy(Bname,d);
strcpy(BAname,e);
strcpy(Bprise,f) ;
}
void input()
{
Publiser::input();
cout << "\nPlease enter book Name ::: ";
cin.getline(Bname,19,'\n');
cout << "\nPlease enter book Auther name ::: ";
cin.getline(BAname,19,'\n');
cout << "\nPlease enter book Prise ::: ";
cin.getline(Bprise,11,'\n');
system("clear");
}
void output()
{
Publiser::output();
cout << "\nName of book Publisher is ::: ";
cout << Bname << endl;
cout << "\nAddres of book Auther name ::: ";
cout << BAname << endl ;
cout << "\nMOBILE NUMBER of book Prise ::: ";
cout << Bprise << endl;
}
};
class Tape :public BOOK
{
protected:
char *Tname,*TSname,*Tprise;
public:
Tape()
{
Tname = new char [20];
TSname = new char [50];
Tprise = new char [12];
}
Tape(char a[] ,char b[] , char c[] , char d[] ,char e[] , char f[], char g[] ,char h[] , char i[] ) :BOOK(a,b,c,d,e,f)
{
Tname = new char [20];
TSname = new char [50];
Tprise = new char [12];
strcpy(Tname,g);
strcpy(TSname,h);
strcpy(Tprise,i) ;
}
void input()
{
BOOK::input();
cout << "\nPlease enter Name of tape::: ";
cin.getline(Tname,19,'\n');
cout << "\nPlease enter Tape singer name ::: ";
cin.getline(TSname,19,'\n');
cout << "\nPlease enter TAPE Prise ::: ";
cin.getline(Tprise,11,'\n');
system("clear");
}
void output()
{
BOOK::output();
cout << "\nName of Tape is ::: ";
cout << Tname << endl;
cout << "\nTape singer name is ::: ";
cout << TSname << endl ;
cout << "\nPrise of tape is ::: ";
cout << Tprise << endl;
}
};
main()
{
Tape x;
x.input();
}