Exam 10: Understanding Inheritance

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

Why are functions sometime overridden in derived classes?

(Essay)
4.8/5
(32)

What should be the first line of the class declaration for the class RV that is both a Vehicle and a Dwelling ?

(Multiple Choice)
4.9/5
(37)

Why does inheritance save you time?

(Essay)
4.8/5
(43)

____ data and functions can be accessed anywhere the class is in scope.

(Multiple Choice)
4.7/5
(41)
Match each term with the correct statement below.
Premises:
when a child class derives from a single parent
Responses:
derived class
override (a function)
reliable class
Correct Answer:
Verified
Premises:
Responses:
when a child class derives from a single parent
derived class
(Matching)
4.9/5
(44)

Many of the constructor complications that occur when inheriting from multiple classes are minimized if you always include ____.

(Multiple Choice)
4.8/5
(36)

To be truly "object-oriented," a programming language must allow inheritance.

(True/False)
4.8/5
(42)
Match each term with the correct statement below.
Premises:
child class
Responses:
invoke a method
virtual
override (a function)
Correct Answer:
Verified
Premises:
Responses:
child class
invoke a method
(Matching)
4.8/5
(39)

Class friendship is not inherited.

(True/False)
4.8/5
(31)
Match each term with the correct statement below.
Premises:
indicates that a base class should be used only once
Responses:
parent class
virtual
derived class
Correct Answer:
Verified
Premises:
Responses:
indicates that a base class should be used only once
parent class
(Matching)
4.9/5
(36)
Match each term with the correct statement below.
Premises:
a child class can derive from more than one base class
Responses:
parent class
multiple inheritance
derived class
Correct Answer:
Verified
Premises:
Responses:
a child class can derive from more than one base class
parent class
(Matching)
4.8/5
(37)

Consider an object aWorker of class Worker , and a variable aPerson of class Person , where Worker is a subclass of Person . Which of the following is valid without writing a specialized function?

(Multiple Choice)
4.9/5
(34)

Consider the following code segments: class Person { private: int idNum; string lastName; string firstName; public: void setFields(int, string, string); void outputData(); }; class Customer : public Person { private: double balanceDue; public: void setBalDue(double); void outputBalDue(); }; void Customer::outputBalDue() { cout What error does the outputBalDue() function have?

(Essay)
4.8/5
(37)
Showing 41 - 53 of 53
close modal

Filters

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