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.
- Multiple type questions.i. Which of the following is not a characteristic of object oriented programming?a) Encapsulationb) Inheritancec) Polymorphism
d) Structured programmingii. In C++, a class is defined using which keyword?a) structb) unionc) classd) objectiii. Which of the following operator cannot be overloaded in C + 2a) +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 classc) It prevents a function from being overridden in derived classes.d) It allows a functions to have default behavior in derived classesv. Which of the following is used to define an inline function in C++?a) inline keywordb) static keywordc) friend keywordd) virtual keywordvi. The 'this' pointer in C++ is used to:Access the current object's membersb) Access static membersc) Access friend functionsd) Access global variablesvii. Which of the following correctly describes the use of a destructor in C++?a) It initializes objectsb) It is called when an object is destroyedc) It allocates memoryd) It cannot be overloaded.viii. What is the purpose of virtual functions in C++?a) To support function overloadingb) To achieve polymorphismc) To support operator overloadingd) To define inline functionsix. 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 - 7a) ifstreamb) ofstreamc) fstreamd) istream - Explain the key concepts of object oriented programming in C++ with 1 examples.
- Describe the differences between structures and classes in C++. How do unions differ from classes? Provide code examples for each.
- What are friend classes and functions in C++? Illustrate their use with appropriate examples.
- Discuss the scope resolution operator in C++ and its significance. Provide exariples to demonstrate its use.
- How are statie data members and static member functions defined and used in C++? Explain with code examples.
- Describe the concept of dynamic memory allocation in C++, How are the new and delete operators used? Provide examples.
- Discuss the concept of inheritance in C++. What are the different types of inheritance supported in C++? Provide examples to illustrate each type.
- 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.
- Explain the C++ I/O syste.n basics. Discuss the various I/O stream classes and formatted I/O operations with examples.
***