Classes and Objects Book Back Questions

11th Standard

    Reg.No. :
  •  
  •  
  •  
  •  
  •  
  •  

Computer Science

Time : 00:45:00 Hrs
Total Marks : 30
    5 x 1 = 5
  1. The variables declared inside the class are known as data members and the functions are known as

    (a)

    data functions

    (b)

    inline functions

    (c)

    member functions

    (d)

    attributes

  2. The member function defined within the class behave like.

    (a)

    inline functions

    (b)

    Non inline function

    (c)

    Outline function

    (d)

    Data function

  3. Which of the following constructor is executed for the following prototype?
    add display (add &): - // add is a class name

    (a)

    Default constructor

    (b)

    Parameterized constructor

    (c)

    Copy constructor

    (d)

    Non Parameterized constructor

  4. What happens when a class with parameterized constructors and having no default constructor is used in a program and we create an object that needs a zero-argument constructor?

    (a)

    Compile-time error

    (b)

    Domain error

    (c)

    Runtime error

    (d)

    Runtime exception

  5. Which of the following create a temporary instance?

    (a)

    Implicit call to the constructor

    (b)

    Explicit call to constructor

    (c)

    Implicit call to the destructor

    (d)

    Explicit call to the destructor

  6. 3 x 2 = 6
  7. What is the difference between the class and object in terms of oop?

  8. Why it is considered as a good practice to define a constructor though compiler can automatically generate a constructor?

  9. Write down the importance of destructor.

  10. 3 x 3 = 9
  11. Write with example how will you dynamically initialize objects?

  12. What are advantages of declaring constructors and destructor under public accessability?

  13. Write the output of the following C++ program code :
    #include
    using namespace std;
    class Calci
    {
    char Grade;
    int Bonus;
    public:
    Calci() {Grade='E'; Bonus=0;} //ascii value of A=65
    void Down(int G)
    {
    Grade-=G;
    }
    void Up(int G)
    {
    Grade+=G;
    Bonus++;
    }
    void Show()
    {
    cout<< Grade << "#" << Bonus << endl; }
    };
    int main()
    {
    Calci c;
    c.Down(3);
    c.Show();
    c.Up(7);
    c.Show();
    c.Down(2);
    c.Show( );
    return 0;
    }

  14. 2 x 5 = 10
  15. Explain nested class with example.

  16. Mention the differences between constructor and destructor

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

TN 11th Standard Computer Science free Online practice tests

Reviews & Comments about 11th Computer Science Chapter 14 Classes and Objects Book Back Questions

Write your Comment