Question: ( 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
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
