MABS Institution
11th Computer Science Monthly Test -2 (Inheritance )-Aug 2020
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
(a) Define Multilevel and Multiple inheritance in context of object Oriented Programming Code suitable example to illustrate the same.
(b) Answer the questions (i) to (iii) based on the following code:
class stationery
{
char Type ;
char manufacturer [10] ;
public:
stationery ( );
void Read_Sta_details ();
void Disp_sta_details( ) ;
};
class office: public stationery
}
int no_of types;
float cost_of_sta ;
public:
void Read_off_details( );
void Disp_off details( ) ;
};
class printer: private office
{
int no_of users ;
char delivary_date[10];
public:
void Read_pri _details( );
void Disp_pri _details( ) ;
};
voidmain()
{ printer Myprinter ;
}
(i) Mention the member names which are accessible by MyPrinter declared in main( ) function.
(ii) What is the size of Myprinter in bytes?
(iii) Mention the names of functions accessible from the member function Read yri-details ( ) of class printer. -
Explain the different types of inheritance.