New ! Computer Science MCQ Practise Tests



11th Standard English Medium Computer Science Subject Inheritance Creative 3 Mark Questions with Solution

11th Standard

    Reg.No. :
  •  
  •  
  •  
  •  
  •  
  •  

Computer Science

Time : 01:00:00 Hrs
Total Marks : 15

    3 Marks

    5 x 3 = 15
  1. Explain the uses of private, protected and public inheritance.

  2. In what situation shadowing base class function inderived class arises? How will you resolve the situation?

  3. Write the output of the following program.
    //Implementation of Single Inheritance using public
    visibility mode
    #include < iostream >
    using namespace std;
    class Shape
    {
    private:
      int count;
    protected:
      int width;
      int height;
    public:
      void setWidth(int w)
      {
      width=w;
      }
    void setHeight(int h)
    {
    height=h;
    }
    };
    class Rectangle: publicShape
    {
    public:
    int getArea()
    {
    return (width * height);
    }
    };
    int main()
    {
    Rectangle Rect;
    Rect.setWidth( 5);
    Rect.setHeight(7);
    II Print the area of theobject.
    cour<< "Total area: "<< Rect.getArea() << endl;
    return ();
    }

  4. Can a derived class get access privilege for a private member of the base class? If yes, how?

  5. Write the derived class using any of the three visibility mode.

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

Reviews & Comments about 11th Standard English Medium Computer Science Subject Inheritance Creative 3 Mark Questions with Solution updated Creative Questions

Write your Comment