Page 297 - C++
P. 297

CBSE AISSCE 2016-2017 Marking Scheme for Computer Science
                                      (Sub Code: 083 Paper Code 91 Outside Delhi)


                   (d)     Answer the questions (i) to (iv) based on the following:                            4
                           class First
                           {
                             int  X1;
                           protected:
                             float X2;
                           public:
                             First();
                             void Enter1(); void Display1();
                           };
                           class Second : private First
                           {
                             int Y1;

                           protected:
                             float Y2;
                           public:
                             Second();
                             void Enter2();
                             void Display();
                           };
                           class Third : public Second
                           {
                             int Z1;
                           public:
                             Third();
                             void Enter3();
                             void Display();
                           };
                           void main()

                           {
                              Third T;                  //Statement 1
                              __________________;//Statement 2
                           }

                       (i)  Which type of Inheritance out of the following is illustrated in the above example?
                          Single Level Inheritance,  Multilevel Inheritance, Multiple Inheritance

                   Ans     Multilevel Inheritance

                           (1 Mark for writing correct option)

                      (ii)  Write the names of all the member functions, which are directly accessible by the
                          object T of class Third as declared in main() function.

                   Ans     Enter2(), Display() of class Second
                           Enter3(), Display() of class Third

                           OR

                                                     Page #7 of 28
   292   293   294   295   296   297   298   299   300   301   302