0% found this document useful (0 votes)
58 views8 pages

Midterm Exam in Oop

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)
58 views8 pages

Midterm Exam in Oop

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/ 8

Sure! Here's a 15-item multiple-choice quiz based on your Lecture 1: Introduction to OOP.

I’ll also
include the answer key at the bottom.

---

Quiz: Introduction to Object-Oriented Programming (OOP)

1. What does OOP stand for?

A. Object-Oriented Processing

B. Object-Oriented Programming

C. Operational-Oriented Programming

D. Object Operating Program

2. In OOP, real-world entities are represented as:

A. Loops

B. Objects

C. Arrays

D. Functions

3. Which of the following is NOT an OOP concept?

A. Encapsulation

B. Inheritance

C. Compilation

D. Polymorphism
4. In OOP, what groups data and methods together?

A. Function

B. Class

C. Interface

D. Module

5. Which concept is about hiding internal details and showing only functionalities?

A. Encapsulation

B. Inheritance

C. Abstraction

D. Compilation

6. What is the real-life example of Encapsulation?

A. A mobile app

B. A bank account hiding its balance

C. A driver starting a car

D. A dog barking

7. Which access modifier hides the data from outside access?

A. Public

B. Private

C. Protected

D. Static

8. Inheritance is best described as:


A. One class taking properties from another class

B. Two classes combining into one

C. Hiding the data

D. Overloading the methods

9. In OOP, a "Car" being a type of "Vehicle" is an example of:

A. Abstraction

B. Encapsulation

C. Inheritance

D. Polymorphism

10. What does Polymorphism allow?

A. Hiding data

B. Multiple classes inheriting from one class

C. Same function behaving differently

D. Breaking a program into modules

11. Which keyword is used in Java to define a class?

A. define

B. class

C. object

D. method

12. Which of these real-life examples shows Abstraction?

A. Using a TV remote
B. A cat meowing

C. A bank account depositing money

D. A car speeding up

13. What is the purpose of encapsulation?

A. Increase the speed of the program

B. Make the program colorful

C. Secure and organize data

D. Allow unlimited inheritance

14. Which is an example of Polymorphism in real life?

A. Different people using different modes of transportation

B. A bank account showing balance

C. A laptop turning on

D. A remote controlling the TV

15. Why do we use OOP?

A. To make programs more complex

B. To avoid using real-world examples

C. To make code modular, reusable, and easier to maintain

D. To create only simple programs

---
Answer Key:

1. B

2. B

3. C

4. B

5. C

6. B

7. B

8. A
9. C

10. C

11. B

12. A

13. C

14. A

15. C

---
Would you also like me to make a printable version (PDF or Word file) if you want to use it directly for a
quiz? Let me know!

Simple Non-Coding Activity: Understanding OOP Concepts

📌 Instructions:

1. Think of a real-life object that can be represented using OOP. (Examples: Car, Phone, Student, Animal)

2. Answer the following questions on paper or in a document:

---

📝 Activity Questions:

1 Identify an Object:
1️⃣

Choose a real-world object (e.g., "Car").

2️⃣Define Attributes (Encapsulation):


List at least three characteristics of your object.

Example for a Car: brand, color, speed

3️⃣Define Behaviors (Methods):

List at least two actions your object can do.

Example for a Car: start(), stop()

4️⃣Apply OOP Principles:

Encapsulation: How will you hide sensitive details?

Abstraction: What details can you hide to make it simple?

Inheritance: Can your object inherit properties from another category? (e.g., Car → Vehicle)

Polymorphism: Can the same action have different behaviors? (e.g., A car can start in different ways:
key, push button, remote)

You might also like