Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Use the following C++ program to answer questions Q5 to Q10? Q5: Write down the FIRST LINE OF OUTPUT. class Bee { protected: int x;

Use the following C++ program to answer questions Q5 to Q10?

Q5: Write down the FIRST LINE OF OUTPUT.

class Bee {

protected:

int x;

public:

Bee(int k) { x=k; }

virtual ~Bee(){ cout << "<1>:" << x << endl; }

virtual void f1() { cout << "<2>"; }

voidf2(){ cout << "<3>"; }

};

class HoneyBee: public Bee {

char c;

public:

HoneyBee(int m, char z):Bee(m) { c = z; }

virtual ~HoneyBee() { cout << "[4]:" << x << "," << c << endl; }

voidf1(){ cout << "[5]"; }

voidf2(){ cout << "[6]"; }

};

int main(){

Bee* wow[2];

wow[0] = new Bee(10);

wow[1] = new HoneyBee(-22, '$');

wow[0]->f1();

wow[1]->f1();

wow[0]->f2();

wow[1]->f2();

delete wow[0];

delete wow[1];

return 0;

could you explain the first,second and third line of output?

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions

Question

How does perception affect behavior?

Answered: 1 week ago