INHERITANCE IN C++ (7)
Consider the following class declaration and answer the questions given below:
class person
{
char Pname [25];
protected:
char Poffice[25];
public:
person();
char City[25];
void Enter();
void Display();
};
class Man:public person
{
long NOM;
char Cityname[25];
protected:
void Association();
public:
Man();
void Add();
void Show();
};
class Children:public Man
{
char State[25];
public:
Children();
void input();
void Output();
};
(i) Which type of inheritance is illustrated in the above example?
(ii) How many bytes does an object belonging to class Chilren require?
(iii) Name of the member functions, which are accessed from the object(s) of class Children.
(iv) Name of the data member(s), which are accessible from the object(s) of class Man.
class person
{
char Pname [25];
protected:
char Poffice[25];
public:
person();
char City[25];
void Enter();
void Display();
};
class Man:public person
{
long NOM;
char Cityname[25];
protected:
void Association();
public:
Man();
void Add();
void Show();
};
class Children:public Man
{
char State[25];
public:
Children();
void input();
void Output();
};
(i) Which type of inheritance is illustrated in the above example?
(ii) How many bytes does an object belonging to class Chilren require?
(iii) Name of the member functions, which are accessed from the object(s) of class Children.
(iv) Name of the data member(s), which are accessible from the object(s) of class Man.
No comments
Post your comments