Exam 15: Inheritance

arrow
  • Select Tags
search iconSearch Question
  • Select Tags

If a base class has public member functions that are not listed by a derived class, then these functions

(Multiple Choice)
4.9/5
(42)

Given the following classes and code, what is the output of the last statement shown? Class Pet { Public: Virtual void print); String name; Private: }; Class Dog: public Pet { Public: Void print); String breed; }; Void Pet::print) { Cout << "My name is " << name; } Void Dog::print) { Pet::print); Cout << ", and my breed is a "<< breed << endl; } Pet pPtr; Dog dPtr; DPtr->name= "Rover"; DPtr->breed="Weiner"; PPtr= dPtr; PPtr->print);

(Multiple Choice)
4.9/5
(34)

Which of the following are not true

(Multiple Choice)
4.8/5
(36)

An object of a derived class can be stored in a base class variable

(True/False)
4.8/5
(40)

C++ implements polymorphism by waiting until run-time to determine which version of a function to use. This is also known as ______________.

(Short Answer)
4.8/5
(33)

The copy constructor from the base class is not inherited into the derived class.

(True/False)
4.9/5
(46)

Which of the following are true?

(Multiple Choice)
4.9/5
(37)

Destructors are not inherited into the derived class.

(True/False)
4.9/5
(41)

Another name for the base class is

(Multiple Choice)
4.8/5
(38)

Using inheritance allows us to

(Multiple Choice)
4.9/5
(48)

If a base class has a virtual function named print, and a pointer variable of that class is pointing to a derived object, then the code ptr->print ); calls

(Multiple Choice)
4.8/5
(38)

If a base class has declared a function to be a virtual function, then does the derived class need to include the word virtual also?

(Short Answer)
4.9/5
(32)

Which is more general, the base class or the derive class.

(Short Answer)
4.8/5
(40)
Showing 41 - 53 of 53
close modal

Filters

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