INHERITANCE IN C++ (9)

Consider the following program and answer the questions (i) to (iv) given below:

class M
{
char Cname[25];
protected:
char Hoffice[25];
public:
M();
char Country[25]
void EnterData();
void DisplayData();
};
class B:public M
{
long NOE;
char Ctry[25];
protected:
void Association():
public:
B();
void Add();
void Show();
};
class O:public B
{
char State[25];
public:
O();
void Enter();
coid Output();
};

(i) Which type of inheritance is shown in the above example?
I. Single Level Inheritance
        II. Multi Level Inheritance
III. Multiple Inheritance
(ii) Write the names of those data members which can be directly accessed from the objects of class O.
(iii) Write the names of those member functions, which can be directly accessed form the objects of class O.
(iv) Write the names of those data members, which can be directly accessed from the Add() function of class B.



No comments

Post your comments

Powered by Blogger.