04. Find the output of the following C++ statements? C++ Statements class TTU (protected: float x; }; class ICT: protected TTU (public: char ch; void Process() { ch= (int) ((60.0+120.0) / 4.0); } void Display() { cout << int(this->ch); }}; void main() { ICT *obj = new ICT; obj->Process(); class BClass { public: obj->Display(); } void print() { cout << x << SClass (string s="", int a= 0) << str << endl; } (cout << "Good Bye from derived class\n"; str = s; x = a; } SClass (char t = 'a', int a = 10, string s= "Example"); -Class() { cout << "Welcome This Base Class\n"; } protected: int x; private: string str; }; class DClass: protected Class { public void print(){ cout << "Good Luck" << endl; }}; void main() { BClass "p; sClass Object("This is the base class", 5*5); p=80bject: p->print(); } class A {public: virtual void Function () { cout<<"Class A1" << endl; }); class A1 { public: void Function() { cout << "Class A" << endl; } }; class 8: public A (public: void Function() { cout << "Class D" << endl; } }; class C: public Al A "pte; Al "ptri; s obj; C obj1; ptr = 8obj; ptr2 = Sobj1; ptri->Function(); ger->Function(); } { public: void Function() { cout << "Class C" << endl; } }; void main()

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter2: Using Data
Section: Chapter Questions
Problem 14RQ
icon
Related questions
Question
All please
04. Find the output of the following C++ statements?
C++ Statements
class TTU
(protected: float x; };
class ICT: protected TTU
(public: char ch;
void Process() { ch= (int) ((60.0+120.0) / 4.0); }
void Display() { cout << int(this->ch); }};
void main()
{
ICT *obj = new ICT;
obj->Process();
obj->Display(); }
class BClass
{ public:
void print() { cout << x <<
sClass (string s="", int a= 0)
<< str << endl; }
(cout << "Good Bye from derived class\n";
str = s; x = a; }
sClass (char t = 'a', int a = 10, string s= "Example");
-8Class() { cout << "Welcome This Base Class\n"; }
protected: int x;
private: string str; };
class DClass: protected BClass
{ public void print(){ cout << "Good Luck" << endl; }};
void main()
(BClass "p;
SClass Object("This is the base class", 5*5);
p=&0bject; p->print(); }
class A
(public:
virtual void Function () { cout<<"Class A1" << endl; });
class Al
{ public:
void Function() { cout << "Class A" << endl; } };
class 8: public A
(public: void Function () { cout << "Class D" << endl; } };
class C: public Al
{ public:
void Function () { cout << "Class C" << endl; } };
void main()
€
A "ptr; Al "ptri;
§ 2bj; Cobj1;
ptr = obj;
ptrl = obj1;
ptri->Function();
ptr->Function(); }
Outp
Transcribed Image Text:04. Find the output of the following C++ statements? C++ Statements class TTU (protected: float x; }; class ICT: protected TTU (public: char ch; void Process() { ch= (int) ((60.0+120.0) / 4.0); } void Display() { cout << int(this->ch); }}; void main() { ICT *obj = new ICT; obj->Process(); obj->Display(); } class BClass { public: void print() { cout << x << sClass (string s="", int a= 0) << str << endl; } (cout << "Good Bye from derived class\n"; str = s; x = a; } sClass (char t = 'a', int a = 10, string s= "Example"); -8Class() { cout << "Welcome This Base Class\n"; } protected: int x; private: string str; }; class DClass: protected BClass { public void print(){ cout << "Good Luck" << endl; }}; void main() (BClass "p; SClass Object("This is the base class", 5*5); p=&0bject; p->print(); } class A (public: virtual void Function () { cout<<"Class A1" << endl; }); class Al { public: void Function() { cout << "Class A" << endl; } }; class 8: public A (public: void Function () { cout << "Class D" << endl; } }; class C: public Al { public: void Function () { cout << "Class C" << endl; } }; void main() € A "ptr; Al "ptri; § 2bj; Cobj1; ptr = obj; ptrl = obj1; ptri->Function(); ptr->Function(); } Outp
Expert Solution
steps

Step by step

Solved in 4 steps with 4 images

Blurred answer
Knowledge Booster
Function Arguments
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
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,