245407-23CB1301 – Object Oriented Programming
245407-23CB1301 – Object Oriented Programming
Register No:
1. What is the difference between ++a and a++? [BL2] [CO1] [2]
2. Define Constants in C. and also list its types. [BL1] [CO1] [2]
3. List the types of function based on return values in C++. [BL2] [CO2] [2]
4. What is the difference between passing a parameter by value and [BL2] [CO2] [2]
by reference in C++?
5. Define data abstraction in C++. [BL1] [CO3] [2]
6. What are the differences between classes and objects in C++? [BL1] [CO3] [2]
7. How do you declare a pointer to an object of a class in C++? [BL1] [CO4] [2]
8. Compare operator overloading and overriding in C++ with example. [BL1] [CO4] [2]
9. Give an example of how to declare a simple class template. [BL1] [CO6] [2]
10. Classify the types of libraries used in C++. [BL1] [CO6] [2]
PART B (5 x 13 = 65 Marks)
11.a Discuss about pointers in C and how they are declared, initialized, [BL3] [CO1] [13]
and used? Write a program to swap two numbers using pointers.
OR
11.b Write a C program demonstrating the use of if, if-else, switch, and [BL3] [CO1] [13]
ternary operator decision-making statement.
Question Paper Code: 245407
12.a Illustrate function overloading in C++, covering its meaning, rules, [BL3] [CO3] [13]
and demonstrate its application with a suitable example.
OR
12.b Explain how pointers can be passed to functions by value or by [BL3] [CO2] [13]
reference in C. Write a program to sort an array using a pointer
passed to a function.
13.a Explain the necessity of Object-Oriented Programming (OOP) and [BL2] [CO3] [13]
how it differs from procedural programming. Discuss the benefits of
using OOP.
OR
13.b Elaborate on the member functions of a class in C++, with [BL2] [CO4] [13]
examples.
14.a Explain the types of inheritance in C++, with appropriate examples. [BL3] [CO5] [13]
OR
14.b Write a program in C++ that uses a base class pointer to refer to [BL3] [CO5] [13]
derived class objects and demonstrates polymorphism using virtual
functions. Discuss how dynamic binding allows different behaviors at
runtime.
15.a Write a C++ program that reads data from the standard input and [BL3] [CO6] [13]
outputs it to the standard output using streams.
OR
15.b Discuss streams in C++, covering their functionalities, types, and [BL3] [CO6] [13]
provide examples to illustrate their usage and benefits.
PART C (1 x 15 = 15 Marks)
16.a Write a C++ program that defines a class for a bank account with [BL5] [CO2] [15]
data members for account balance and member functions for
depositing and withdrawing money. Explain how encapsulation is
used to protect the integrity of the account balance.
OR
16.b Develop a user defined exception for handling divide by zero error. [BL5] [CO6] [15]
Also discuss about user defined exceptions and pre-defined
exceptions in detail.
**********