CS305 Object Oriented Programming
CS305 Object Oriented Programming
CS305 Object Oriented Programming
1. Which of the following best describes a key difference between Object-Oriented Programming
(OOP) and Procedural Programming?
A) OOP focuses on data rather than procedures.
B) Procedural Programming doesn't support encapsulation.
C) OOP doesn't allow for code reusability.
D) Procedural Programming lacks inheritance.
9. Which term describes the process of creating new objects from existing ones?
A) Abstraction
B) Encapsulation
C) Polymorphism
D) Inheritance
10. Which paradigm advocates breaking down software into reusable, self-contained units?
A) Object-Oriented Programming
B) Functional Programming
C) Imperative Programming
D) Procedural Programming
9. What is the term for the process of destroying objects in Object-Oriented Programming?
A) Construction
B) Destructive method
C) Destructor
D) Garbage collection
10. When identifying classes in Object-Oriented Programming, what are candidates for classes?
A) Methods
B) Attributes
C) Shared behavior and state
D) Message passing strategies
2. What term best describes the relationship between a subclass and its superclass in inheritance?
A) Has-a
B) Is-a
C) Association
D) Aggregation
5. What term is used to describe a stronger form of association where one class "owns" objects of
another class?
A) Inheritance
B) Aggregation
C) Composition
D) Encapsulation
10. Which relationship in Object-Oriented Programming allows for the reusability of code by enabling
a subclass to inherit features from a superclass?
A) Aggregation
B) Association
C) Inheritance
D) Composition
Unit 4: Polymorphism
1. What is polymorphism in Object-Oriented Programming?
A) The process of hiding the implementation details of an object's state
B) The process of creating duplicate objects
C) The ability of a method to do different things based on the object it is acting upon
D) The process of defining multiple constructors for a class
Unit 5:
1. Which of the following best describes a String in C++?
A) A primitive data-type
B) An array of characters
C) An object that represents a sequence of characters
D) A class that cannot be instantiated
5. In a Library Management System, what data collection might be used to store information about
books and their availability?
A) ArrayList
B) HashSet
C) TreeMap
D) LinkedList
10. In a Library Management System, what data collection might be used to store information about
library members and their borrowed books?
A) HashSet
B) LinkedList
C) TreeMap
D) HashMap