Question: CSC 2 4 0 C + + classes and inheritance Type in the following C + + program into a file classes.cpp / BASE CLASS
CSC C classes and inheritance
Type in the following program into a file classes.cppBASE CLASSclass Aprotected:int x;public:A x ;void increment x; virtual void decrement x; ;void print cout x x endl; DERIVED CLASSclass B : public Apublic:void increment x x ; ;void decrement x x ; MAIN FUNCTIONint mainA a; a is an object of class AA ptr; ptr is a pointer to an object of class Aptr &a;ptr increment;ptr print;ptr decrement;ptr print;
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
