INHERITANCE IN C++ (1)

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

class MANAGER
{
int Mgr_no;
char MGR_Name[20];
protectd:
char dept[20];
public:
MANAGER();
void mentry();
void mdisplay();
};
class EMPLOYEE
{
int emp_no;
char emp_name[20];
protected:
float salary;
public:
EMPLOYEE();
void Eentry();
void Edisplay();
};
class COMPANY:private MANAGER, public EMPLOYEE
{
char Cmp_no[10];
char estb_date[8];
public:
char description[20];
COMPANY();
void Centry();
void Cdetail();
};

(i) Which type of inheritance is shown in the above example?
(ii) Write the names of data members which are accessible from objects belongs to class COMPANY.
(iii) Write the names of all the member functions which are accessible from the objects belongs to class COMPANY.
(iv) Write the names of all the data members which are accessible from member functions of EMPLOYEE.



No comments

Post your comments

Powered by Blogger.