Govt. of Karnataka, Department of Technical Education
Diploma in Computer Science & Engineering
Subject: OOP with C++
Max. Marks: 100 Max. Time: 3 Hours
Model Question Paper
Note: 1. Section –I is compulsory.
2. Answer any TWO questions from each remaining Sections. Marks
Section – I
1. a) Fill in the blanks with appropriate word/s 5x1=5
i. …… is an alias name given to a variable.
ii. ……. is a special member function that initializes the data members of a class.
iii. The process of deriving one class from more than one base class is called-----
iv. A ……. Function can accept a value of any type.
v. The ------ class provides the functionality for performing read operation from a file.
b) Compare POP V/S OOP. 5
Section – II
2. a) Explain the const qualifier . 5
b) Write a c++ program to illustrate an inline function. 5
c) Explain function Overloading with an example 5
3. a) Define a class. 2
b) Write a program to illustrate constructor overloading. 8
c) Explain the concept of constructor with default arguments. 5
4. a) What is a friend function? Explain with an example. 5
b) How are static data members declared and defined? Explain. 6
c) What is the significance of operator overloading? 4
Section – III
5. a) Write a c++ program to add two complex objects by overloading the ‘+ ‘operator. 10
b) What is type conversion? 2
c) What is inheritance? List out the types of Inheritance. 3
6. a) What is Multiple Inheritance? Write a c++ program to illustrate
Multiple Inheritance 10
b) Explain the concept of Nesting of Classes. 5
7. a) Explain the use of this pointer. 5
b) . Create a base class called 'SHAPE' having 10
- two data members of type double
- member function get-data( ) to initialize base class data members
- Pure virtual member function display-area ( ) to compute and display the
area of the geometrical object.
Derive two specific classes 'TRIANGLE' and 'RECTANGLE' from
the base class. Using these three classes design a program that will accept
dimension of a triangle / rectangle interactively and display the area.
Section – IV
8. a) With examples explain unformatted I /O operations. 5
b) Explain the built in monitors in C++ with examples. 10
9. a) Write a program to illustrate the user defined manipulators with arguments. 5
b) What are the built in classes for a file? Explain. 6
c) What are the different modes to open a file? 4
10. a) Write a note on command line arguments. 5
b) What is a template? 2
c) Write a program to illustrate class template with multiple parameters. 8