wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Midterm: Quiz 1 OOP

Total questions: 50

Worksheet time: 25mins

Name
Class
Date
1.

Jane is developing software and wants to organize her code into reusable units that group data and methods together. Which programming paradigm is she using?

a)

Procedural

b)

Functional

c)

Object-Oriented

d)

Structural

2.

  In a program, an object named `Car` has properties like `color` and `model`, and methods like `drive()` and `brake()`. What does this best demonstrate?

a)

Arrays

b)

Objects

c)

Files

d)

Tables

3.

You are asked to define a method inside a class that calculates area. What OOP concept are you demonstrating?

a)

Encapsulation

b)

Inheritance

c)

Polymorphism

d)

Abstraction

4.

A developer wants to build a software application that uses data structures such as arrays, trees, and records. What concept do these structures fall under?

a)

Control Flow

b)

Data Fields

c)

Data Structures

d)

Functions

5.

Which of the following best defines Object-Oriented Programming (OOP)?

a)

Programming around procedures

b)

Programming around functions and logic

c)

Programming around data or objects

d)

Programming around databases

6.

A student wrote code where a class Box contains private variables. Only methods inside the class can access them. What OOP feature is this?

a)

Inheritance

b)

Abstraction

c)

Polymorphism

d)

Encapsulation

7.

You are designing a base class Animal, and subclasses like Dog and Cat inherit from it. What OOP concept is demonstrated?

a)

Polymorphism

b)

Inheritance

c)

Message Passing

d)

Encapsulation

8.

What is the term for structuring programs into self-contained, reusable pieces of code?

a)

Modular Programming

b)

OOP

c)

Scripting

d)

Procedural Programming

9.

A developer creates several methods with the same name but different parameters to handle different tasks. This is an example of:

a)

Function Chaining

b)

Method Binding

c)

Polymorphism

d)

Encapsulation

10.

You are writing a method in C# to add two numbers. Where should this method be written?

a)

Outside any class

b)

Inside the compiler

c)

Inside a class

d)

Inside a file

11.

A class Shape defines the method draw(). Each subclass overrides this method for its own behavior. This is an example of:

a)

Abstraction

b)

Overloading

c)

Polymorphism

d)

Encapsulation

12.

Which feature of OOP hides complex code implementation details from the user?

a)

Abstraction

b)

Inheritance

c)

Generic Classes

d)

Arrays

13.

A Box class has private attributes. Which method type allows controlled access to these private variables?

a)

Overloaded operators

b)

Setters and getters

c)

Direct variable manipulation

d)

Delegates

14.

You want to write a class in C# that can store any data type using the same structure. What should you use?

a)

Arrays

b)

Abstract Classes

c)

Generic Classes

d)

Static Classes

15.

In a project, different objects call methods from other objects and pass values. What OOP feature does this show?

a)

Class Libraries

b)

Abstraction

c)

Message Passing

d)

Inheritance

16.

What do you call the built-in, language-specific groups of reusable classes available in C#?

a)

Class Hierarchies

b)

Class Definitions

c)

Class Libraries

d)

Generic Classes

17.

A class Vehicle can be extended by Truck and Bike, allowing reuse of code. This represents:

a)

Inheritance

b)

Message Passing

c)

Abstraction

d)

Polymorphism

18.

What OOP characteristic allows two functions with the same name to perform different tasks?

a)

Inheritance

b)

Polymorphism

c)

Abstraction

d)

Encapsulation

19.

What term describes combining data fields and methods into a single unit?

a)

Polymorphism

b)

Class Libraries

c)

Encapsulation

d)

Message Passing

20.

You define a class template without specifying the type of data it will store. This is a:

a)

Class Library

b)

Interface

c)

Generic Class

d)

Static Class

21.

Which of the following best represents encapsulation?

a)

Overloading the method print()

b)

Sending data between objects

c)

Protecting internal object details

d)

Reusing code from a base class

22.

Why is inheritance important in OOP?

a)

It secures private data

b)

It increases execution speed

c)

It supports code reusability

d)

It defines the object interface

23.

If a developer writes multiple methods called draw() in the same class, each taking different parameters, what OOP concept is being applied?

a)

Method Chaining

b)

Encapsulation

c)

Inheritance

d)

Function Overloading

24.

Which OOP feature enhances flexibility by allowing the same interface to act differently in different classes?

a)

Message Passing

b)

Abstraction

c)

Polymorphism

d)

Data Hiding

25.

What characteristic of OOP helps reduce code duplication and improves scalability?

a)

Polymorphism

b)

Class Libraries

c)

Inheritance

d)

Message Passing

26.

Which company developed the C# programming language?

a)

Google

b)

Apple

c)

Microsoft

d)

IBM

27.

You are writing C# code in Visual Studio. Which platform is this environment part of?

a)

Unity

b)

.NET

c)

Python

d)

Eclipse

28.

What type of applications can be built using C#?

a)

Only web-based applications

b)

Mobile apps only

c)

Almost all types of software

d)

Game development only

29.

If you're creating a dynamic website using ASP.NET, what language will you likely use for backend logic?

a)

Python

b)

Java

c)

C#

d)

Kotlin

30.

Which C# feature lets you define a variable inside a class?

a)

Data Fields

b)

Methods

c)

Interfaces

d)

Delegates

31.

What is a method in C#?

a)

A command line argument

b)

A class property

c)

A block of code containing statements

d)

A design template

32.

Fields in C# are defined using:

a)

File Headers

b)

Command Line Options

c)

Access Modifiers, Type, and Name

d)

Function Prototypes

33.

Which part of a C# program is responsible for executing specific tasks when invoked?

a)

Constructor

b)

Field

c)

Method

d)

Class

34.

A field declared private int age; inside a class demonstrates what principle?

a)

Overloading

b)

Abstraction

c)

Encapsulation

d)

Class Library

35.

To perform a series of actions when a method is called in C#, where is the logic written?

a)

In fields

b)

In the constructor

c)

In the method body

d)

In the main file

36.

You're building an app where a User class should be able to reuse code from a Person class. Which concept should you use?

a)

Composition

b)

Inheritance

c)

Aggregation

d)

Reflection

37.

If a robot class has a method move() that behaves differently in FlyingRobot and WalkingRobot, this is an example of:

a)

Data Hiding

b)

Encapsulation

c)

Polymorphism

d)

Inheritance

38.

A game developer wants to use the same method attack() across different character classes. Which OOP principle allows this?

a)

Inheritance

b)

Message Passing

c)

Polymorphism

d)

Abstraction

39.

You're writing a class for BankAccount that only allows access to balance through specific methods. What is this?

a)

Method Chaining

b)

Inheritance

c)

Encapsulation

d)

Generics

40.

A developer creates a class that can accept different data types and behave the same way. What class type is this?

a)

Abstract Class

b)

Interface

c)

Generic Class

d)

Static Class

41.

An object in a program sends a message to another object requesting data. This is an example of:

a)

Delegation

b)

Message Passing

c)

Polymorphism

d)

Inheritance

42.

What keyword is commonly used in C# to define data fields as accessible only inside their class?

a)

public

b)

internal

c)

protected

d)

private

43.

Which Visual Studio feature helps organize classes into reusable code components?

a)

Code Lens

b)

Class Library

c)

Namespace Viewer

d)

Solution Explorer

44.

Which concept allows you to change the implementation of a method in a subclass?

a)

Encapsulation

b)

Polymorphism

c)

Inheritance

d)

Method Overriding

45.

What is the benefit of using message passing in OOP?

a)

Better speed

b)

Code duplication

c)

Object communication

d)

Memory reduction

46.

If an attribute is declared protected, where can it be accessed?

a)

Only within the class

b)

In child classes

c)

In any class

d)

In the compiler

47.

A student created a class with a method that accepts different parameter types. What feature is being used?

a)

Overriding

b)

Overloading

c)

Inheritance

d)

Abstraction

48.

What C# concept allows the developer to specify default access control for fields or methods?

a)

Properties

b)

Interfaces

c)

Access Modifiers

d)

Delegates

49.

Why is abstraction used in OOP?

a)

To hide internal code complexity

b)

To duplicate code

c)

To reduce memory

d)

To improve security only

50.

Which of the following statements is TRUE about C# and OOP?

a)

C# does not support OOP

b)

You cannot define classes in C#

c)

C# fully supports all OOP principles

d)

Fields and methods cannot coexist in a class