CORRECT | VERIFIED AND APPROVED
Assume that Publication is the root class of an inheritance tree. You want
to form a linked list of different publications in the inheritance tree, including
Book, Report, Newspaper, etc. What is the best way to create a linked list
using PublListNode and Publication classes?
A.
The PublListNode class contains the Publication class.
B.
The Publication class is derived from the PublListNode class.
C.
The PublListNode class is derived from the Publication class.
D.
,The Publication class contains the PublListNode class. - ✔✔A.
The PublListNode class contains the Publication class.
If the relation between two C++ classes can be best described as "is-a"
relation, we should
A.
contain one class in the other (containment).
B.
define them to be independent of each other.
C.
derive one class from the other (inheritance).
D.
merge them into a single class. - ✔✔C.
derive one class from the other (inheritance)
Consider C++'s typing system. C++ uses (Select all correct answers)
,A. value semantics for its primitive types (such as integer and float) only.
B. both value semantics and reference semantics for its object types.
C. both value semantics and reference semantics for its primitive types .
D. reference semantics for its object types only. - ✔✔B.
both value semantics and reference semantics for its object types.
C.
both value semantics and reference semantics for its primitive types .
What does the following line of code define?
Days operator++(int)
An overloaded operator *
A new class Days.
a new int type. - ✔✔An overloaded operator ++
, What does the following line of code define?
bool operator>(const Cylinder &c)
A virtual function Cylindarer
An overloaded operator >
An overloaded operator &
An overloaded function Cylinder - ✔✔An overloaded operator >
You can define two overloading operations with the same operator name,
but with different parameter types.
True
False - ✔✔True
Which statements or operations will call the destructor of a class? Select all
that apply.