Class Inheritance
Class Inheritance
Class Inheritance
{ public :
int id; void getd();
protected : void showd();
char name[20]; };
char doj[20]; class Payment : private Daily_wager
public : {
Employee();
~Employee(); char date[10];
void get(); protected :
void show(); int amount;
}; public :
class Daily_wager : protected Employee Payment();
{ ~Payment();
int wphour; void show();
};
protected :
class PUBLISHER public:
{ class Pub[12]; BRANCH() ;
double Turnover; void Haveit();
protected; void Giveit();
void Register(); };
public : class AUTHOR : private BRANCH, public Publisher
PUBLISHER(); { int Acode;
void Enter (); char Aname[20];
void Display(); float Amount:
}; public:
class BRANCH AUTHOR();
{ char CITY[20] ; void Start();
protected : void Show(); };
float Employees ;
(i) Name the members which can be accessed from the member
functions of class
(ii) Name the members, which can be accessed by an object of class
(iii) What will be the size of an object (in bytes) of class
(iv) Name the class(es) that can access read() declared in livingbeing
class.
(v) Write the names of data members, which are accessible from objects
belonging to class
(vi) How many bytes wiil be required by an object belonging to class
?
(vii) Is ---------is accessible through the object of
(viii) Name the base class and derived class of the class state.
(ix) Name the data members that can be accessed from function
(x) Is the member function -----------accessible by the objects of the
class state?