Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

Govt Post Graduate College (W) Model Town.

Time: 90 Minutes Marks:25

Mid Term

ADP(IT), 3rd Semester Subject: Object Oriented Programming

Encircle the Right option.

1. The constructor for a class is called when:


a. A function is called b. An object needs destructor
c. possible d. An object is created
2. Which sections of a class can member function of that class access?
a. Private b. Protected c. Public d. All
3. A base class may have at most ______ child class derived from it.
a. 1 b. 12 c. 7 d. any number
4. When a derived class has two or more base classes, this situation is known as:
a. Multiple Inheritance b. Friend Function c. Polymorphism d. None
5. Dynamic Binding in C++ occurs at:
Compile time b. Run time c. Link time d. None

SUBJECTIVE
Q#2. Answer the following questions:
i. What is multiple inheritance? Explain with program.
(5)
ii. Explain Problem Solving in OO Paradigm? What are concepts of Object
Oriented Programming?
(5)

Q#3. (10)

Write a class Person that has attributes of id, name and address. It has a
constructor to initialize, a member function to input and a member function to display
data members. Create another class Student that inherits Person class. It has additional
attributes roll_number and marks. It also has member function to input and display its
data members.

You might also like