Multiple Choice 1. (TCO 2) Supposeyou have the following UML class diagram of a
ID: 3529377 • Letter: M
Question
Multiple Choice
1. (TCO 2) Supposeyou have the following UML class diagram of a class.Which of the following is an accessor? (Points : 4) incrementHours
setTime
getTime
clockType
2. (TCO 2) The components of a class are called the ____ of the class. (Points : 4) elements
members
objects
properties
3. (TCO 2) In a class, all the function members _____. (Points : 4) must be public, and all the member variables must be private
must be public, and all the member variables must be public also
themember variables can be either public or private
must be private, and all the member variables must be public
4. (TCO 3) Composition is when one or more members of a class are _____. (Points : 4) accessed by member functions of the same class
objects of another class type
defined in a separate file
created in a class-tester program
5. (TCO 3) Composition and inheritance are two fundamental ways of relating _____. (Points : 4) classes
objects
class function members
class data members
6. (TCO 3) Which is the correct UML connector to designate composition? (Points : 4)
7. (TCO 3) Which is a true statement about classes and structures? (Points : 4) Both classes and structures are private by default.
Both classes and structures are public by default.
Classes are public by default, but structures are private.
Structures are public by default, by class are private.
8. (TCO 4) The constructor of a derived class _____. (Points : 4) cannot specify a call to the constructor of a base class in the body of the constructor function definition
can specify a call to the constructor of a base class only when the access specifier for the class set is protected
can specify a call to the constructor of a base class in the body of the function definition
can specify a call to the constructor of a base class in the body of the constructor function definition
9. (TCO 4) OOP implements ____. (Points : 4) UML
IPE
EIP
OOD
10. (TCO 4) Using inheritance, when a class is derived from a base class, it can be described as _____. (Points : 4) a case of going from a specific definition to a general definition
a case of going from a general definition to a more specific definition
a means of adding objects as data members of another class
preventing objects of the base class from ever being instantiated
Explanation / Answer
1 clockType
2
members
3
themember variables can be either public or private
4
objects of another class type
5
classes
6
4th option
7 Both classes and structures are public by default.
8 can specify a call to the constructor of a base class only when the access specifier for the class set is protected
9 UML
10 preventing objects of the base class from ever being instantiated
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.