Answered step by step
Verified Expert Solution
Question
1 Approved Answer
( 2 0 pts ) Given the following classes: class CRecyclable { public: void C l s ( ) { cout CR endl;
pts Given the following classes:
class CRecyclable
public:
void cout CR endl;
virtual void Type;
virtual void Unit cout "Pounds endl;
virtual void Name;
;
class CPaper : public CRecyclable
public:
void Type cout "Paper endl;
void Unit cout Tons endl;
virtual void Name cout "Paper ;
;
class CNewspaper : public CPaper
public:
virtual void Type cout "News" endl;
virtual void Unit cout "Lines end;
virtual void Name CPaper: Name; cout "New" endl;
;
For the following code, indicate what each line will output in the blank following the line:
CPaper paper;
CNewspaper news;
CNewspaper pnews new CNewspaper;
CRecyclable rec &paper;
CRecyclable rec &news;
paper.Type;
news. Type ;
pnewsType
recType;
recType;
paper.Cls;
rec;
recUnit;
recUnit;
recName;
points each.
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