New ! Computer Science MCQ Practise Tests



11th Standard English Medium Computer Science Subject Inheritance Book Back 5 Mark Questions with Solution

11th Standard

    Reg.No. :
  •  
  •  
  •  
  •  
  •  
  •  

Computer Science

Time : 01:00:00 Hrs
Total Marks : 25

    5 Marks

    5 x 5 = 25
  1. Explain the different types of inheritance.

  2. Explain the different visibility mode through pictorial representation.

  3. Consider the following c++ code and answer the questions
    class Personal
    {
    int Class,Rno;
    char Section;
    protected:
    char Name[20];
    public:
    personal();
    void pentry();
    voidPdisplay();
    };
    class Marks:private Personal
    {
    float M{5};
    protected:
    char Grade[5];
    public:
    Marks();
    void M entry();
    void M display();
    };
    class Result:public Marks
    {
    float Total,Agg;
    public:
    char FinalGrade, Commence[20];
    Result();
    void R calculate();
    void R display();
    }:
    (i) Which type of Inheritance is shown in the program?

  4. #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?
      

  5. Write the output of the following program
    #include< iostream >
    using namespace std;
    class A
    {
    protected:
    int x;
    public:
    void show()
    {
    cout<<"x = "<<x<<endl;}
    A()
    {
    cout<<endl<<" I am class A "<<endl;}
    ~A( )
    {
    cout<<endl<<" Bye ";} };
    };
    class B : public A
    {
    protected:
    int y;
    public:
    B(int x, int y)
    { x = x1;
    y = y1; }
    B( )
    {
    cout<<endl<<" I am class B "<<endl; }
    ~B( )
    {
    cout<<endl<<" Bye "; }
    void show( )
    {
    cout<<"x = "<<x<<endl;
    cout<<"y = "<<y<<endl; }
    };
    int main( )
    {
    A objA;
    B objB(30, 20);
    objB.show( );
    return 0;
    }

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

Reviews & Comments about 11th Standard English Medium Computer Science Subject Inheritance Book Back 5 Mark Questions with Solution

Write your Comment