Question: ( 2 0 pts ) Given the following classes: class CRecyclable { public: void C l s ( ) { cout CR endl;

(20 pts) Given the following classes:
class CRecyclable
{
public:
void Cls(){ cout "CR " endl; }
virtual void Type()=0;
virtual void Unit(){ cout "Pounds " endl; }
virtual void Name()=0;
};
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 " end1; }
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 ?** rec1= &paper;
CRecyclable *rec2= &news;
paper.Type();
news. Type ();
pnews->Type()
rec1->Type();
rec2->Type();
paper.Cls(); =
rec1>Cls();
rec1->Unit();
rec2->Unit();
rec2->Name();
2 points each.
 (20 pts) Given the following classes: class CRecyclable { public: void

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!