INHERITANCE IN C++ (3)

Answer the questions (i) to (iv) based on the following code:

        class Shape
{
int length;
protected:
int width,hight;
public:
void getDimension(int,int,int);
void dispDimension();
};

class SideShape:protected Shape
{
int Sidelength,SideWidth;
protected:
void getSide(injt,int);
public:
void dispSide();
};

class SubShape:public SideShape
{
int SubLength;
void display(void);
public:
void enter();
};


(i) Name of the base class and derived claass of the class SideShape.
(ii) Name of the data member(s) that can be accessed from function dispSide().
(iii) Name of the private members functions(s) of class SubShape.
(iv)Which type of inheritance is illustrated in the above example?




No comments

Post your comments

Powered by Blogger.