Database System Concepts
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
Bartleby Related Questions Icon

Related questions

Question

Display the output:

28
cout << "
In dClassOne::Display()";
29
bClass::Display();
I3D
30
cout <« " d1s = " « d1s « endl;
31
};
void Print()
33
{
34
cout « " In dClassOne::Print()";
35
bClass::Print();
36
cout « " d1s = " « d1s « endl;
37 } private:
38
string d1s;
39 };
class dClassTwo : public bClass
{
40
41
public:
dClassTwo(string ddata = " dClassTwoData ", string bdata= " bClassDataFromD2 ")
42
43
%3D
44
:bClass(bdata), d2s(ddata) {};
45
virtual void Display(int i)
46 {
47
48
cout <« " In dClassTwo::Display()"; bClass::Display(); cout<<"d2s="<<d2s<<"i="<<i< endl;
}; private:
string d2s;
};
49
50
52
void Output( bClass &R)
{
54
R.Display();
}
55
56
57
int main() {
bClass A("Object A");
dClassOne B("Object B");
60
dClassTwo C("Object C", "Object C ( ObjectC_A ) ");
61
bClass *Ptr;
62
Ptr
&B;
Ptr->Display();
Output(A);
Output(B);
A = B;
63
64
65
A.Display();
68
Ptr = &B;
%3D
69
Ptr->Print();
70
C.Display(3);
71
Ptr = &C;
Ptr->Display();
return 0; }
72
73
74
m 3 m33
345 670 90l 234 O7
60
n55 555O
556 666O 6
699
expand button
Transcribed Image Text:28 cout << " In dClassOne::Display()"; 29 bClass::Display(); I3D 30 cout <« " d1s = " « d1s « endl; 31 }; void Print() 33 { 34 cout « " In dClassOne::Print()"; 35 bClass::Print(); 36 cout « " d1s = " « d1s « endl; 37 } private: 38 string d1s; 39 }; class dClassTwo : public bClass { 40 41 public: dClassTwo(string ddata = " dClassTwoData ", string bdata= " bClassDataFromD2 ") 42 43 %3D 44 :bClass(bdata), d2s(ddata) {}; 45 virtual void Display(int i) 46 { 47 48 cout <« " In dClassTwo::Display()"; bClass::Display(); cout<<"d2s="<<d2s<<"i="<<i< endl; }; private: string d2s; }; 49 50 52 void Output( bClass &R) { 54 R.Display(); } 55 56 57 int main() { bClass A("Object A"); dClassOne B("Object B"); 60 dClassTwo C("Object C", "Object C ( ObjectC_A ) "); 61 bClass *Ptr; 62 Ptr &B; Ptr->Display(); Output(A); Output(B); A = B; 63 64 65 A.Display(); 68 Ptr = &B; %3D 69 Ptr->Print(); 70 C.Display(3); 71 Ptr = &C; Ptr->Display(); return 0; } 72 73 74 m 3 m33 345 670 90l 234 O7 60 n55 555O 556 666O 6 699
1
#include <iostream>
#include <string>
3.
nt
using namespace std;
4
class bClass
{
7
public:
bClass(string data = "bClassData"):bs(data) {};
virtual void Display()
8.
al
9.
10
{
cout << "In bClass::Display() ";
cout <« "bs = " « bs « endl;
11
12
13
};
14
void Print()
15
{
16
cout << "In bClass::Print() ";
17
cout << "bs
<« bs << endl;
18
}
private:
string bs;
};
19
20
21
22
class dClassOne : public bClass
23
{
public:
dClassOne(string data = "dClassOneData"):d1s(data) {};
virtual void Display()
24
25
26
27
{
cout <« " In dClassOne::Display()";
bClass::Display();
28
29
expand button
Transcribed Image Text:1 #include <iostream> #include <string> 3. nt using namespace std; 4 class bClass { 7 public: bClass(string data = "bClassData"):bs(data) {}; virtual void Display() 8. al 9. 10 { cout << "In bClass::Display() "; cout <« "bs = " « bs « endl; 11 12 13 }; 14 void Print() 15 { 16 cout << "In bClass::Print() "; 17 cout << "bs <« bs << endl; 18 } private: string bs; }; 19 20 21 22 class dClassOne : public bClass 23 { public: dClassOne(string data = "dClassOneData"):d1s(data) {}; virtual void Display() 24 25 26 27 { cout <« " In dClassOne::Display()"; bClass::Display(); 28 29
Expert Solution
Check Mark
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education