Quiz 1 Flashcards

1
Q

Which of the following is not true regarding abstraction?

a) Abstraction extracts important
information from less important
information

b) Abstraction specifies how information is handled
c) Focuses on important properties of objects while ignoring inessential details
d) Can be both high level and low level depending on scope

A

b

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Encapsulation ____________

a) enforces inclusion of an object’s data
and its functionality within the object

b) protects data elements from being
accidently modified

c) implements the “has-a” relationship
between objects

d) A and B above
e) B and C above
f) All of the above

A

d

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Grouping a set of classes into discrete units is known as _______

a) Modularity
b) Inheritance
c) Abstraction
d) Packaging

A

a

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Identify the correct statement: In a single inheritance structure, _____

a) a class can have one or more sub-
classes

b) a class can have one or more superclasses
c) a class can have exactly one sub-class

d) a sub-class cannot provide additional
properties
A

a

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

By default, the variables defined in a sub- class in C++ are

a) public
b) protected
c) private
d) friend

A

c

How well did you know this?
1
Not at all
2
3
4
5
Perfectly