Question
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started