Question Paper 2021 Introduction To Object Oriented Programming
Question Paper 2021 Introduction To Object Oriented Programming
2
32) What happens if the following C++ statement is compiled and executed?
int *ptr = NULL;
delete ptr;
(a) The program is not semantically correct
(b) The program is compiled and executed successfully
(c) The program gives a compile-time error
(d) The program compiled successfully but throws an error during run-time
33) Which of the following is correct about this pointer in C++?
(a) this pointer is passed as a hidden argument in all static variables of a class
(b) this pointer is passed as a hidden argument in all the functions of a class
(c) this pointer is passed as a hidden argument in all non-static functions of a class
(d) this pointer is passed as a hidden argument in all static functions of a class
34) Which of the following type is provided by C++ but not C?
(a) double
(b) float
(c) int
(d) bool
35) What is Inheritance in C++?
(a) Deriving new classes from existing classes
(b) Overloading of classes
(c) Classes with same names
(d) Wrapping of data into a single class
L1,
2. What is a reference variable? What is its major use? Give one programming example. CO1
L2
L1,
What do you mean by overloading of a function? When do we use this concept? Justify
3. CO2 L2,
your answer with proper example.
L3
4. What is a friend function? Explain the special characteristics of a friend function with CO3 L1,
3
suitable examples. L2
Write a C++ program to create a class called STRING and Implement the following
operations. Display the result after every operation by overloading the operator <<.
L3,
5. I. STRING S1= 'VTU' CO2
L6
II. STRING S2 = 'BELGAUM'
Write a C++ program using class ITEMS that will create a shopping list where you can add
L3,
6. or delete the item from a list, find the total values (in Rs.) of the all items and display the CO3
L6
list with cost of the items.
List the types of inheritances and explain with examples. Write a C++ program to L1,
1. CO1
implement hierarchal inheritance with public access specific. L3
Differentiate between early binding and late binding, with an example explain how late L2,
2. CO2
binding can be achieved in C++. L3
Describe the mechanism of accessing data members and member functions in the
following cases with suitable examples:
L2,
3. a) Inside the main program CO3
L4
b) Inside a member function of the same class
c) Inside a member function of the another class
L1,
What is an operator function? Describe the syntax of an operator function. Write a
4. CO2 L3,
program to overload ‘+’ operator to concatenate two strings.
L6
CO* - Course Outcomes from Syllabus, BL* - Bloom’s Taxonomy Levels (1: Remembering, 2: Understanding,
3: Applying, 4: Analyzing, 5: Evaluating, 6: Creating)
END
4