New ! Computer Science MCQ Practise Tests



11th Standard English Medium Computer Science Subject Polymorphism Book Back 1 Mark Questions with Solution Part - II

11th Standard

    Reg.No. :
  •  
  •  
  •  
  •  
  •  
  •  

Computer Science

Time : 01:00:00 Hrs
Total Marks : 5

    1 Marks

    5 x 1 = 5
  1. Which of the following function(s) combination
    cannot be considered as
    overloaded function(s) in the given snippet?
    void print(char A, int B); //Fl
    void printprint(int A; float B); //F2
    void Print(int P=10);//F3
    void prtntt); //F4

    (a)

    F1,F2,F3,F4

    (b)

    F1,F2,F3

    (c)

    F1,F2,F4

    (d)

    F1,F3,F4

  2. Which of the following operator is by default overloaded by the compiler?

    (a)

    *

    (b)

    +

    (c)

    +=

    (d)

    ==

  3. #include< iostream >
    using namespace std;
    class Point {
    private:
    int x, y;
    public:
    point(int x1,int y1)
    {
    x=x1;y=y1;
    }
    void operator+(Point&pt3);
    void showO {cout << "x=" << x << " ,y=" << y;}
    };
    void Point::operator+(point &pt3)
    {
    x + =pt3.x;
    y+=pt3.y;
    }
    int main ()
    {
    point ptl(3,2),pt2(5,4);
    pt1+pt2;
    pt1.show ();
    return 0;
    }
    Which ofthe following operator is overloaded?

    (a)

    +

    (b)

    operator

    (c)

    ::

    (d)

    =

  4. #include< iostream >
    using namespace std;
    class Point {
    private:
    int x, y;
    public:
    point(int x1,int y1)
    {
    x=x1;y=y1;
    }
    void operator+(Point&pt3);
    void showO {cout << "x=" << x << " ,y=" << y;}
    };
    void Point::operator+(point &pt3)
    {
    x + =pt3.x;
    y+=pt3.y;
    }
    int main ()
    {
    point ptl(3,2),pt2(5,4);
    pt1+pt2;
    pt1.show ();
    return 0;
    }
    Which of the following statement invoke operator overloading?

    (a)

    pt1+pt2

    (b)

    Pointpt1(3,2),pt2(5,4)

    (c)

    pt1.showt);

    (d)

    return 0;

  5. #include< iostream >
    using namespace std;
    class Point {
    private:
    int x, y;
    public:
    point(int x1,int y1)
    {
    x=x1;y=y1;
    }
    void operator+(Point & pt3);
    void showO {cout << "x=" << x << " ,y=" << y;}
    };
    void Point::operator+(point & pt3)
    {
    x + =pt3.x;
    y+=pt3.y;
    }
    int main ()
    {
    point pt1(3,2),pt2(5,4);
    pt1+pt2;
    pt1.show ();
    return 0;
    }
    What is the output for the above program?

    (a)

    x=8,y=6

    (b)

    x=14,y=:14

    (c)

    x = 8, y =6

    (d)

    = x =5, y = 9

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

Reviews & Comments about 11th Standard English Medium Computer Science Subject Polymorphism Book Back 1 Mark Questions with Solution Part - II

Write your Comment