New ! Computer Science MCQ Practise Tests



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 a 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:
    x()
    {}
    };
    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?
      

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

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

Write your Comment