KEMBAR78
Class Inheritance | PDF
0% found this document useful (0 votes)
23 views3 pages

Class Inheritance

The document discusses class relationships and access specifiers in C++. It defines several classes with different access levels and asks questions about which members can be accessed from which classes and objects. Determining access for data members and member functions in derived classes and objects is the focus.

Uploaded by

Ganesh Dumka
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views3 pages

Class Inheritance

The document discusses class relationships and access specifiers in C++. It defines several classes with different access levels and asks questions about which members can be accessed from which classes and objects. Determining access for data members and member functions in derived classes and objects is the focus.

Uploaded by

Ganesh Dumka
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

class Employee int nofhworked;

{ 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?

You might also like