2024 - BCA [2nd Semester] - Object Oriented Programming with C++ - Purnea University


PU-2 BCA-3
B.C.A. (II-SEMESTER)
EXAMINATION, JUNE-2024
OBJECT ORIENTED PROGRAMMING WITH C++
Time: 3 Hours                                                                   Full Marks: 70

Note: The questions are equal value.
Answer any live questions.

  1. Multiple type questions.
    i. Which of the following is not a characteristic of object oriented programming?
       a) Encapsulation
       b) Inheritance
       c) Polymorphism
       d) Structured programming
    ii. In C++, a class is defined using which keyword?
       a) struct
       b) union
       c) class
       d) object
    iii. Which of the following operator cannot be overloaded in C + 2
       a) +
       b) =
       c) ::
       d) []
    iv. Which of the following correctly describes the purpose of a pure virtual function in C++?
       a) It allows a function to be overridden in derived classes.
       b) It defines a function that must be overridden in any derived class
       c) It prevents a function from being overridden in derived classes.
       d) It allows a functions to have default behavior in derived classes
    v. Which of the following is used to define an inline function in C++?
       a) inline keyword
       b) static keyword
       c) friend keyword
      d) virtual keyword
    vi. The 'this' pointer in C++ is used to:
       Access the current object's members
       b) Access static members
       c) Access friend functions
       d) Access global variables
    vii. Which of the following correctly describes the use of a destructor in C++?
       a)  It initializes objects
       b) It is called when an object is destroyed
       c) It allocates memory
       d) It cannot be overloaded.
    viii. What is the purpose of virtual functions in C++?
       a) To support function overloading
       b) To achieve polymorphism
       c) To support operator overloading
       d) To define inline functions
    ix. Which of the following is the correct syntax to pass an array of objects in C++?
       a) Object obj[]= new Object[10];
       b) Object obj [10];
       c) Object obj = new Object]10[:
       d) Object obj(10);
    x. Which stream class is used for file input in C - 7
       a) ifstream
       b) ofstream
       c) fstream
       d) istream

  2. Explain the key concepts of object oriented programming in C++ with 1 examples.

  3. Describe the differences between structures and classes in C++. How do unions differ from classes? Provide code examples for each.

  4. What are friend classes and functions in C++? Illustrate their use with appropriate examples.

  5. Discuss the scope resolution operator in C++ and its significance. Provide exariples to demonstrate its use.

  6. How are statie data members and static member functions defined and used in C++? Explain with code examples.

  7. Describe the concept of dynamic memory allocation in C++, How are the new and delete operators used? Provide examples.

  8. Discuss the concept of inheritance in C++. What are the different types of inheritance supported in C++? Provide examples to illustrate each type.

  9. What is polymorphism in C++? Explain the difference between compile time and runtime polymorphism with examples. Discuss the role of virtual functions in achieving polymorphism.

  10. Explain the C++ I/O syste.n basics. Discuss the various I/O stream classes and formatted I/O operations with examples.
***