INHERITANCE IN C++ (15)

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

class PUBLISHER
{
char Pub[12];
double Turnover;
protected;
void Register();
public:
PUBLISHER();
void Enter();
void Display();
};

class BRANCH
{
char CITY[20];
protected:
float Employees;
public:
BRANCH();
void Haveit();
void Giveit();
};

class AUTHOR:private BRANCH, public PUBLISHER
{
int Acode;
char Aname[20];
float Amount;
public:
AUTHOR();
void Start();
void Show();
};

(i) Which type of Inheritance is illustrated in the above example?
(ii) Write names of all the member functions, which are accessible from objects belonging to class BRANCH.
(iii) Write the names of all the members, which are accessible from member functions of class AUTHOR.
(iv) How many bytes will be required by an object belonging to class AUTHOR?


No comments

Post your comments

Powered by Blogger.