Object Oriented Programming - B.Tech Examination, 2013

2013Semester 3Civil-CAEnd Semester
Aryabhatta Knowledge University, Patna
B.Tech Examination, 2013

Object Oriented Programming

Time: 03 HoursCode: 051401Full Marks: 70

Instructions:

  1. All questions carry equal marks.
  2. There are NINE questions in this paper.
  3. Attempt FIVE questions in all.
  4. Question No. 1 is compulsory.
Q.1 Choose the correct answer (any seven) :[14]
  1. Which of the following statements is correct?

    1. A reference is stored on heap
    2. A reference is stored on stack
    3. A reference is stored in a queue
    4. A reference is stored in a binary tree
  2. How many parameters does a Default Constructor accept?

    1. 0
    2. 1
    3. 2
    4. 3
  3. Destructor has the same name as the constructor and it is preceded by

    1. ~
    2. !
    3. &
    4. ?
  4. Which of the following types of class allows only one object of it to be created?

    1. Virtual class
    2. Abstract class
    3. Singleton class
    4. Friend class
  5. Which of the following statements is correct?

    1. Two functions having same number of argument, order and type of argument can be overloaded if both functions do not have any default argument
    2. Overloaded function must have default arguments
    3. Overloaded function must have default arguments starting from the left of argument list
    4. A function can be overloaded more than once
  6. Which of the following statements is incorrect?

    1. Default arguments can be provided for pointers to functions
    2. A function can have all its arguments as default
    3. Default argument cannot be provided for pointers to functions
    4. A default argument cannot be redefined in later declaration
  7. Which of the following is not a type of constructor?

    1. Copy constructor
    2. Friend constructor
    3. Default constructor
    4. Parameterized constructor
  8. Which of the following access specifies is used in a class definition by default?

    1. Protected
    2. Public
    3. Private
    4. Friend
  9. Which of the following statements is correct with respect to the use of friend keyword inside a class?

    1. A private data member can be declared as a friend
    2. A class may be declared as a friend
    3. An object may be declared as a friend
    4. We can use friend keyword as a class name
  10. How many types of polymorphisms are supported by C++?

    1. 1
    2. 2
    3. 3
    4. 4
Q.2 Solve both questions :[14]
  1. Define string. How does a string type differ from C type string?

  2. WAP in C++ that reads a particular string and displays the frequency of each character in the string.

Q.3 Solve both questions :[14]
  1. What is ST? Describe with example.

  2. WAP in C++ using the function count() to how many elements in a container have a specified value.

Q.4 Solve both questions :[14]
  1. Explain exception handling and their types.

  2. WAP in C++ to demonstrate the use of multiple Catch statements.

Q.5 Solve both questions :[14]
  1. Describe streams.

  2. Write about the following functions: put(); get(); width(); getline(); fill().

Q.6 Solve both questions :[14]
  1. Describe polymorphism with suitable examples.

  2. WAP in C++ using array of pointers to accept desired number of integers and display their sum.

Q.7 Solve this question :[14]
  1. What is inheritance? Describe its types with examples.

Q.8 Solve both questions :[14]
  1. Explain 'this' pointer. Differentiate between overloaded functions and function templates.

  2. What is a virtual function? WAP to demonstrate use of virtual functions.

Q.9 Solve both questions :[14]
  1. Explain friend function along with example.

  2. Describe type conversion with examples.