Inheritance Book Back Questions

11th Standard

    Reg.No. :
  •  
  •  
  •  
  •  
  •  
  •  

Computer Science

Time : 00:45:00 Hrs
Total Marks : 30
    5 x 1 = 5
  1. Which of the following derives a class student from the base class school

    (a)

    school: student

    (b)

    class student: public school

    (c)

    student: public school

    (d)

    class school: public student

  2. Inheritance is process of creating new class from

    (a)

    Base class

    (b)

    abstract

    (c)

    derived class

    (d)

    Function

  3. A class is derived from a class which is a derived class itself, then this is referred to as__________

    (a)

    multiple inheritance

    (b)

    multilevel inheritance

    (c)

    single inheritance

    (d)

    double inheritance

  4. Which of the following is true with respect to inheritance?

    (a)

    Private members of base class are inherited to the derived class with private.

    (b)

    Private members of base class are not inherited to the derived class with private accessibility

    (c)

    public members of base class are inherited but not visible to the derived class.

    (d)

    Protected members of base class are inherited but not visible to the outside class.

  5. class x
    {int a;
    public:
    xOn
    };
    class y
    {x x1;
    public:
    y(){}
    };
    class z : public y,x
    {
    int b;
    public:
    z(){}
    }z1;
    What is the order of constructor for object zl to be invoked?

    (a)

    z,y,x,x

    (b)

    x,y,z,x

    (c)

    y,x,x,z

    (d)

    z,y,z

  6. 3 x 2 = 6
  7. What is inheritance?

  8. What is a base class?

  9. What is the difference between public and private visibility mode?

  10. 3 x 3 = 9
  11. What is the difference between polymorphism and inheritance though are used for reusability of code?

  12. What do you mean by overriding?

  13. Write some facts about the execution of constructors and destructors in inheritance.

  14. 2 x 5 = 10
  15. Explain the different types of inheritance.

  16. #include< iostream >
    #include< string >
    #include
    using name spacestd;
    class publisher
    {
    char pname[15];
    char hoffice[15];
    char address[25];
    double turnover;
    protected:
    char phone[3][10];
    void register( );
    public:
    publisher( );
    ~publisher( );
    void enter data( );
    void disp data( );
    };
    class branch
    {
    charbcity[15];
    char baddress[25];
    protected:
    intno_of_emp;
    public:
    charbphone[2][10];
    branch( );
    ~branch( );
    void have data( );
    void give data( );
    };
    class author: public branch, publisher
    {
    intaut_code;
    charaname[20];
    float income;
    public:
    author( );
    ~author( );
    voidgetdata( );
    voidputdata( );
    };
    (i) Which type of Inheritance is shown in the program?
    (ii) Specify the visibility mode of base classes.
    (iii) Give the sequence of Constructor/Destructor Invocation when object of class author is created.
    (iv) Name the base class(/es) and derived class (/es).
    (v) Give number of bytes to be occupied by the object of the following class:
    (a) publisher (b) branch (c) author
    (vi) Write the names of data members accessible from the object of class author
    (vii) Write the names of all member functions accessible from the object of class author.
    (viii) Write the names of all members accessible from member functionsof class author.

*****************************************

TN 11th Standard Computer Science free Online practice tests

Reviews & Comments about 11th Computer Science - Inheritance Book Back Questions

Write your Comment