wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Object-Oriented Design Final Exam

Total questions: 23

Worksheet time: 16mins

Name
Class
Date
1.

The first stage of the two-stage design process is (a)   design.

2.

The second stage of the two-stage design process is (a)   design.

3.

Which of these conceptual design techniques will help you analyze the problem space to determine classes for your object-oriented software?
Choose the two correct answers.

a)

mockups

b)

requirements

c)

CRC

d)

tradeoffs

4.

During conceptual design, once the problem is mapped into components, what are the other two critical pieces of information that you must specify for these classes or components?
Choose the two correct answers.

a)

methods

b)

responsibilities

c)

collaborators

d)

abstract data types

5.

You are writing the CRC card for a Bear component.
Choose the two responsibilities.

a)

eat berries

b)

hunger

c)

camper

d)

den

6.

You are writing the CRC card for a Bear component.
Choose the three collaborators.

a)

tree

b)

computer

c)

den

d)

guitar

e)

bear

7.

You create an object that represents a user, storing important information about them such as their preferences. What kind of object is this?

a)

control

b)

client

c)

entity

d)

boundary

8.

You create an object that represents a dialog box. It creates buttons and text fields, etc, for the user to interact with, and it logs those interactions. What kind of object is this?

a)

control

b)

interaction

c)

entity

d)

boundary

e)

display

9.

You create an object that compares values from two different sources. It then updates the smaller value to be equal to the larger one. What kind of object is this?

a)

control

b)

update

c)

entity

d)

repository

10.

Which of these is an example of a quality tradeoff?

a)

Adding security knowing it will reduce speed

b)

Not delivering key features so that deadlines can be met

c)

Adding preferences that allow users to switch some features on and off

d)

Limiting features knowing that they can be added later

11.

What is the term for reducing a class or object to its inputs and outputs in modelling?

a)

filter thinking

b)

black box thinking

c)

pipe thinking

d)

process thinking

12.

Which one of these classes is in most need of being decomposed?

a)

Student

b)

Book

c)

Store

d)

Order

13.

Which design principle enables developers to follow the guideline D.R.Y. ("Don't Repeat Yourself"):

a)

encapsulation

b)

generalization

c)

abstraction

d)

decomposition

14.

Select the object pairing that has an association relationship:

a)

Tree - Root

b)

Coffee - Water

c)

Book - Page

d)

Hiker - Trail

15.

Select the object pairing that has an aggregation relationship:

a)

Car - Road

b)

Pie - Crust

c)

Book - Page

d)

Stapler - Staple

16.

Select the object pairing that has a composition relationship:

a)

Bear - Forest

b)

Tea - Sugar

c)

Book - Page

d)

Record Player- Record -

17.

Choose the two answers that correctly complete the following sentence:

"We say that a class has low cohesion if..."

a)

...it tries to encapsulate too many unrelated responsibilities.

b)

...its purpose is unclear.

c)

...it does not have all the necessary parts, i.e. it is incomplete.

d)

...connects to many other classes.

18.

Two classes are tightly coupled. What are some ways you might be able to tell
Choose the two correct answers.

a)

In order to understand one class, you need to open up the other to look at the implementation

b)

Their interactions are limited and controlled

c)

They can easily be swapped with different implementations of the same class

d)

They are very highly reliant on each other

19.

How can you apply the principle of Separation of Concerns in object-oriented programming?

a)

Ensure classes are only concerned with their own data

b)

Separate data and actions (methods) into different classes

c)

Separate objects or components according to their role in the software

d)

Split developers into teams that each deal with different parts of the software

20.

Which of these violates Liskov's Substitution Principle?

a)

the superclass is too general

b)

the subclass adds behaviour

c)

subclasses specify the abstract methods of the superclass

d)

an operation in the superclass is replaced by a different operation in the subclass

21.

For which of these situations would you use a sequence diagram?

a)

To show the different modes that your program can be in.

b)

To show the relationship between classes

c)

To show all of the different processes of your program.

d)

To show the collaborative behaviour of objects in your program.

22.

What is the purpose of model checking?

a)

To check the software for errors before release

b)

To verify that the conceptual model of your software matches the customer's requirements.

c)

To test for user-reported bugs

d)

To verify that the technical implementation matches conceptual mockups

23.

What is an abstract data type?

a)

variables that are assigned a type (i.e. integer, double) but does not yet have a value assigned.

b)

a data type that cannot be used directly but must be implemented as an interface

c)

a type of data defined by the developer rather than the language.

d)

a data-centric class