Monday 14 January 2013

Chapter 2: Introduction to Object Orientation


Multiple-Choice Questions


1.      The behavioral operations of a class are implemented as:

a.       methods.
b.      attributes.
c.       compositions.
d.      activities.

Answer: a                          Page Reference:  34                           Difficulty:  Moderate


2.      The state of a class is determined by the value of its:

a.       methods.
b.      determinants.
c.       state values
d.      attributes.

Answer: d                         Page Reference:  34                           Difficulty:  Moderate


3.      Which of the following is NOT included in a operation’s signature?

a.       Name
b.      Implementation
c.       Parameters
d.      Return type

Answer: b                         Page Reference:  35                           Difficulty:  Moderate



4.      A defining characteristic of encapsulation is that:

a.       properties of the parent class also exist in the child class.
b.      specific objects are grouped into broader categories.
c.       implementation details of attributes and methods are hidden.
d.      related classes are grouped into packages.

Answer: c                          Page Reference:  35-36                                  Difficulty:  Moderate

5.      Inheritance relationships exist between:

a.       instances and classes.
b.      superclasses and subclasses.
c.       attributes and operations.
d.      packages and components.

Answer: b                         Page Reference:  36                           Difficulty:  Moderate


6.      All automobiles have steering wheels. A sedan is a type of automobile. Therefore a sedan as a steering wheel. Which term best fits this description?

a.       Inheritance
b.      Aggregation
c.       Instantiation
d.      Composition

Answer: a                          Page Reference:  36-37                                  Difficulty:  Moderate


7.      A single message “drawYourself()” is sent to two types of window objects. One type of window object responds by painting a bar chart. The other responds by displaying a photographic image. Which term best describes this scenario?

a.       Inheritance
b.      Composition
c.       Abstraction
d.      Polymorphism

Answer: d                         Page Reference:  37                           Difficulty:  Moderate


8.      The class’s interface is primarily composed of:

a.       images of its outputs.
b.      signatures of its operations.
c.       diagrams of its sequences.
d.      links to its superclasses.

Answer: b                         Page Reference:  38                           Difficulty:  Moderate


9.      Which of the following describes an association relationship?

a.       An employee works for a department.
b.      A student is a type of person.
c.       A credit card is identified by its account number.
d.      An object is an instance of a class.

Answer: a                          Page Reference:  39                           Difficulty:  Hard
10.  Which of the following best describes an aggregation relationship?

a.       Animals are classified as birds, mammals, fish, and insects.
b.      George, Louise, and Frank are all related to one another.
c.       Fido, Rover, and Rex are all dogs.
d.      A computer includes a CPU, RAM, and disk drive.

Answer: d                         Page Reference:  39                           Difficulty:  Hard


11.  A composition is a type of:

a.       operation.
b.      generalization.
c.       aggregation.
d.      instantiation.

Answer: c                          Page Reference:  39                           Difficulty:  Moderate


12.  A(n) ____________ is an abstraction of a system, usually depicted via diagrams.

a.       model.
b.      implementation.
c.       formula.
d.      class.

Answer: a                          Page Reference:  40                           Difficulty:  Moderate


13.  Which of the following is the best description of an abstraction?

a.       Shirts, pants, and socks are all types of clothing.
b.      An architect’s blueprint models the actual building.
c.       The components of a system can be interchanged at will.
d.      A class includes attributes and methods.

Answer: b                         Page Reference:  40                           Difficulty:  Moderate


14.  Booch, Rumbaugh, and Jacobson are known as the:

a.       founders of object orientation.
b.      originators of Javas.
c.       developers of the Smalltalk language.
d.      creators of UML.

Answer: d                         Page Reference:  40                           Difficulty:  Moderate



15.  The first object-oriented programming language was:

a.       UML.
b.      Smalltalk.
c.       SIMULA.
d.      C++.

Answer: c                          Page Reference:  40                           Difficulty:  Moderate


16.  Which type of UML diagram depicts actors interacting with a system?

a.       Interaction
b.      Use case
c.       Communication
d.      Activity

Answer: b                         Page Reference:  41                           Difficulty:  Moderate


17.  Time-ordered interactions among objects are depicted in a UML ____________ diagram.

a.       communication
b.      activity
c.       statechart
d.      sequence

Answer: d                         Page Reference:  41                           Difficulty:  Moderate


18.  A communication diagram is appropriate for:

a.       identifying how a user works with the system.
b.      describing the associations between classes.
c.       showing the interactions between objects.
d.      illustrating the sequence of activities in a system.

Answer: c                          Page Reference:  41                           Difficulty:  Moderate


19.  Association and generalization relationships are shown in a UML ____________ diagram.

a.       class
b.      relationship
c.       component
d.      deployment

Answer: a                          Page Reference:  41                           Difficulty:  Moderate



20.  Which UML diagram captures dynamic aspects of a system?

a.       Class
b.      Component
c.       State
d.      Object

Answer: c                          Page Reference:  42                           Difficulty:  Moderate

No comments:

Post a Comment