Home
Expert Answers
Place Order
How It Works
About Us
Contact Us
Sign In / Sign Up
Sign In
Sign Up
Home
/
Expert Answers
/
Computer Science
/ in-the-following-c-program-indicate-the-8-outputs-produced-if-the-code-contains-any-bugs-poin-pa232
(Solved): In the following C++ program, indicate the 8 outputs produced. If the code contains any bugs, poin ...
In the following
C
+
+
program, indicate the 8 outputs produced. If the code contains any bugs, point them out in the code and explain why. class show \} public: void alter()
{
cout
?<
2
<<
endl;
}
virtual void bank() cout
?
4
<<
endi;
}
void change()
{
cout
?
6
<<
endi;
}
virtual void dock() (cout
?
8
?
endl;
}
3; class live: public show \{ public: void alter()
{
cout
?
12
?
endl;
}
void bank()
{
cout
?
14
?
endi;
}
void change()
{
cout
?
16
?
endl; \} class opera: public live
?
public: void alter() ( cout
?
22
?
endl;
}
void bank()
{
cout
?
24
?
endi;
}
void
dock
(
)
(cout
?
26
?
endl;
}
1 void main() \{ show * firstPtr,
?
secondPtr,
?
thirdPtr; firstPtr = new show () ; second
Ptr
=
new live () : thirdPtr = new opera(); thirdPtr->alter(); // Output 1: firstPtr
>
bank
(
)
II Output 2: thirdPtr->bank(): I/ Output 3: secondPtr->change(): I/ Output 4 : secondPtr
>
dock(); II Output
5
:
live * fourthPtr, * fifthPtr, " sixthPtr; fourthPtr = new show ()
;
fifthPtr = new live(); sixthPtr = new opera(); sixthPtr->alter();
//
Output
6
:
fifthPtr->change();
// Output 7 : sixthPtr->dock ()
;
// Output
8
:
\}
We have an Answer from Expert
View Expert Answer
Expert Answer
Here code need the more correction and will
We have an Answer from Expert
Buy This Answer $5
Place Order
We Provide Services Across The Globe
Order Now
Go To Answered Questions