Exam 11: Inheritance and Composition

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

C++ provides ____________________ functions as a means to implement polymorphism in an inheritance hierarchy.

Free
(Short Answer)
4.8/5
(35)
Correct Answer:
Verified

virtual

Objects are created when ____________________ variables are declared.

Free
(Short Answer)
4.7/5
(43)
Correct Answer:
Verified

class

____ is a "has-a" relationship.

Free
(Multiple Choice)
4.8/5
(48)
Correct Answer:
Verified

C

To ____ a public member function of a base class in the derived class, the corresponding function in the derived class must have the same name, number, and types of parameters.

(Multiple Choice)
4.7/5
(36)

In ____________________ polymorphism, the (data) type is left unspecified and then later instantiated.

(Short Answer)
4.8/5
(31)

The private members of a base class can be directly accessed by a derived class.

(True/False)
4.8/5
(46)

The new classes that we create from existing classes are called ____ classes.

(Multiple Choice)
4.8/5
(42)

Which of the following is a valid definition of the derived class bClass?

(Multiple Choice)
4.9/5
(47)

The constructors of a derived class can (directly) initialize only the (public data) members inherited from the base class of the derived class.

(True/False)
4.7/5
(37)

The OOP terminology is influenced by the vocabulary of ____________________, the OOP language largely developed at a Xerox research center during the 1970s.

(Short Answer)
4.9/5
(42)

Which of the following class definitions makes the public members of the class aClass become the public members of the class bClass?

(Multiple Choice)
4.7/5
(26)

If the derived class does not override a public member function of the base class, you may specify a call to that public member function by using the name of the function and the appropriate parameter list.

(True/False)
4.9/5
(36)

The ____ members of an object form its external state.

(Multiple Choice)
4.8/5
(38)

The class io is the base class of the C++ stream classes istream and ostream.

(True/False)
4.8/5
(38)

In OOD, a program is a collection of interacting ____________________; in structured programming, a program is a collection of interacting functions.

(Short Answer)
4.7/5
(34)

The preprocessor directive ____________________ is used to prevent multiple inclusions of a header file in a program.

(Short Answer)
4.8/5
(28)

Inheritance is an example of a(n) ____ relationship.

(Multiple Choice)
4.8/5
(43)

A call to the base class's constructor is specified in the heading of the definition of a derived class constructor.

(True/False)
4.8/5
(42)

If inheritance is public, all protected members of the base class are ____________________ members of the derived class.

(Short Answer)
4.9/5
(37)

OOP implements ____.

(Multiple Choice)
4.8/5
(41)
Showing 1 - 20 of 50
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)