Page 248 - C++
P. 248

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

                             int  A1;
                           protected:
                             float A2;
                           public:
                             One();
                             void Get1(); void Show1();
                           };
                           class Two : private One
                           {
                             int B1;
                           protected:
                             float B2;
                           public:
                             Two();
                             void Get2();
                             void Show();
                           };
                           class Three : public Two
                           {
                             int C1;
                           public:
                             Three();
                             void Get3();
                             void Show();
                           };
                           void main()
                           {
                              Three 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 Three as declared in main() function.

                   Ans    Get3(),Show() of class Three
                          Get2(),Show() of class Two
                          OR
                          Get3(),Show() ​OR​ Three::Show()
                          Get2(),Two::Show()

                          (1 Mark for writing all correct function names )

                          NOTE:
                              ●  Marks not to be awarded for partially correct answer
                              ●  Ignore the mention of Constructors

                     (iii)  Write Statement 2 to call function Show() of class Two from the object T of class
                          Three.


                                                     Page #7 of 28
   243   244   245   246   247   248   249   250   251   252   253