Q2: 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 Author : private Branch, public Publisher
{
int acode;
char aname[20];
float amount;
public:
Author();
void start();
void show();
};
i. Write the names of data members, which are accessible from objects belonging to class Author.
ii. Write the 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?
1
Expert's answer
2021-10-16T11:03:57-0400
i) No data members, objects can only access member functions enter(), display(), start(), show()
Comments
Leave a comment