0% found this document useful (0 votes)
170 views3 pages

Mid Term Paper 2023: Part-I

The document appears to be a midterm exam paper for an Object Oriented Programming course. It contains three parts - multiple choice questions about OOP concepts, short answer questions requiring explanation of OOP terms and features, and two long answer questions about inheritance and polymorphism.

Uploaded by

Maryam Safdar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
170 views3 pages

Mid Term Paper 2023: Part-I

The document appears to be a midterm exam paper for an Object Oriented Programming course. It contains three parts - multiple choice questions about OOP concepts, short answer questions requiring explanation of OOP terms and features, and two long answer questions about inheritance and polymorphism.

Uploaded by

Maryam Safdar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

MID TERM PAPER 2023

Name: ___________________________ Roll No(LCAST): __________


Program: BSCS Semester: 3rd
Subject: Object Oriented Programming
Total Marks: 60 Time:2 hrs
PART-I
Q 1. Choose the correct option (20*1=20)
1. Who invented OOP?
a) Andrea Ferro b) Adele Goldberg c) Alan Kay d) Dennis Ritchie
2. Which is not a feature of OOP in general definitions?
a) Efficient Code b) Code reusability c) Modularity d) Duplicate/Redundant
data
3. Which was the first purely object oriented programming language developed?
a) Kotlin b) SmallTalk c) Java d) C++
4. When OOP concept did first came into picture?
a) 1980’s b) 1995 c) 1970’s d) 1993
5. Which feature of OOP indicates code reusability?
a) Abstraction b) Polymorphism c) Encapsulation d) Inheritance
6. Which header file is required in C++ to use OOP?
a) OOP can be used without using any header file b) stdlib.h
c) iostream.h d) stdio.h
7. Why Java is Partially OOP language?
a) It allows code to be written outside classes b) It supports usual declaration of primitive data types
c) It does not support pointers d) It doesn’t support all types of inheritance
8. Which among the following doesn’t come under OOP concept?
a) Data hiding b) Message passing c) Platform independent d) Data binding
9. Which is the correct syntax of inheritance?
a) class base_classname :access derived_classname{ /*define class body*/ };
b) class derived_classname : access base_classname{ /*define class body*/ };
c) class derived_classname : base_classname{ /*define class body*/ };
d) class base_classname : derived_classname{ /*define class body*/ };
10. Which feature of OOP is indicated by the following code?

class student{ int marks; };


class topper:public student{ int age; topper(int age){ this.age=age; } };

a) Encapsulation and Inheritance b) Inheritance and polymorphism


c) Polymorphism d) Inheritance
11. The feature by which one object can interact with another object is _____________
a) Message reading b) Message Passing c) Data transfer d) Data Binding
12. Which among the following, for a pure OOP language, is true?
a) The language should follow at least 1 feature of OOP
b) The language must follow only 3 features of OOP
c) The language must follow all the rules of OOP
d) The language should follow 3 or more features of OOP
13. How many types of access specifiers are provided in OOP (C++)?
a) 4 b) 3 c) 2 d) 1
14. In multilevel inheritance, which is the most significant feature of OOP used?
a) Code efficiency b) Code readability c) Flexibility d) Code reusability
15. What is encapsulation in OOP?
a) It is a way of combining various data members and member functions that operate on those data members into a
single unit
b) It is a way of combining various data members and member functions into a single unit which can operate on any
data
c) It is a way of combining various data members into a single unit
d) It is a way of combining various member functions into a single unit
16. Which of the following is not true about polymorphism?
a) Helps in redefining the same functionality
b) Increases overhead of function definition always
c) It is feature of OOP
d) Ease in readability of program
17. Which constructor will be called from the object created in the below C++ code?

class A
{
int i;
A()
{
i=0; cout<<i;
}
A(int x=0)
{
i=x; cout<<I;
}
};
A obj1;

a) Parameterized constructor b) Default constructor


c) Run time error d) Compile time error
18. What is an abstraction in object-oriented programming?
a) Hiding the implementation and showing only the features
b) Hiding the important data
c) Hiding the implementation
d) Showing the important data
19. Which among the following can show polymorphism?
a) Overloading && b) Overloading <<
c) Overloading || d) Overloading +=
20. In which access should a constructor be defined, so that object of the class can be created in any function?
a) Any access specifier will work b) Private c) Public d) Protected

PART-II

Q 2. Write short answer of the following questions (10*2=20)


1. Explain OOP
2. What is Class and object in OOP explain with example
3. What are the four fundamental principles of OOP?
4. How do interfaces promote flexibility in OOP?
5. Describe the concept of method overriding in OOP. When and why would you override a method in a subclass?
6. Discuss the role of access modifiers (e.g., public, private, protected) in OOP. How do they control access to class
members and contribute to encapsulation?
7. How does abstraction help in OOP?
8. What are Constructor and Destructor.
9. Differentiate between Getter and Setter function.
10. Write name of constructor type.

PART-III

Answer the following questions in detail (10*2=20)


Q 3. Explain Inheritance also explain these types 1) Multiple inheritance 2) Multi level inheritance 3) Hybrid
inheritance (10)
Q 4. What is Polymorphism and its type in detail. (10)

You might also like