CBSE eBooks CBSE Guess > eBooks > Class XII > Computer Science By . Mr. MRK
Chapter – 6. INHERITANCE DELHI 2008 2.d. Answer the questions (i) to(iv) based on the following code : class Dolls (i) Which type of Inheritance is shown in the above example? Ans: Hierarchical Inheritance. Since the sub classes are derived from a single base class(Dolls). (ii) How many bytes will be required by an object of the class ElectronicDolls ? Ans: 41 Bytes (Explonation: The memory will be reserved as follows: char Dcode[5]; //5 Bytes float Price; //4 Bytes char EDName[20]; //20 Bytes char BatteryType[10]; //10 Bytes int Batteries; //2 Bytes Total = 41 Bytes ) (iii) Write name of all data members accessible from member function of the class SoftDolls. Ans: Dolls::Price, SoftDolls:: SDName, SoftDolls::Weight (iv) Write name of member functions accessible an object of the class ElectronicDolls? Ans: ElectronicDolls::EDInput( ), |