
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
Display the output:

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

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

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 2 steps with 1 images

Knowledge Booster
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.Similar questions
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education