Exam 11: Inheritance and Composition

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

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

Free
(True/False)
4.7/5
(33)
Correct Answer:
Verified

False

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

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

#ifndef

____ is the ability to use the same expression to denote different operations.

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

C

Which of the following is true about inheritance?

(Multiple Choice)
4.7/5
(35)

In protected inheritance, public and protected members of the base class become the protected members of the derived class.

(True/False)
4.8/5
(40)

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

(Multiple Choice)
5.0/5
(34)

What is the output of the following program? What is the output of the following program?

(Multiple Choice)
4.8/5
(35)

If the derived class classD overrides a public member function functionName of the base class classB, then to specify a call to that public member function of the base class, you use the statement ____.

(Multiple Choice)
4.8/5
(32)

Suppose that bClass is a class.Which of the following statements correctly derives the class dClass from bClass?

(Multiple Choice)
4.7/5
(39)

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

(Multiple Choice)
4.9/5
(38)

____ is a "has-a" relationship.

(Multiple Choice)
5.0/5
(34)

Which of the following statements about inheritance is true if memberAccessSpecifier is protected?

(Multiple Choice)
4.9/5
(38)

The ____ members of an object form its external state.

(Multiple Choice)
4.8/5
(30)

C++ provides ____ functions as a means to implement polymorphism in an inheritance hierarchy, which allows the run-time selection of appropriate member functions.

(Multiple Choice)
4.9/5
(33)

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

(Short Answer)
4.9/5
(40)

A derived class cannot directly access public members of a base class.

(True/False)
4.7/5
(28)

Existing classes, from which you create new classes, are called ____ classes.

(Multiple Choice)
4.9/5
(36)

Classes can create new classes from existing classes.This important feature ____.

(Multiple Choice)
4.9/5
(44)

____ is the ability to combine data, and operations on that data, in a single unit.

(Multiple Choice)
4.9/5
(31)

Consider the following class definitions:Which of the following correctly sets the values of x and y? Consider the following class definitions:Which of the following correctly sets the values of x and y?

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

Filters

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