Learn C++ Online

Inheritance (part 1)

On this page
This lesson contains approximately 30 minutes of video content.

Introduction

Motivation

Introduction to inheritance

Visibility of inheritance

Questions

Q1

QInheritance Pt 1, Q1

This question is ungraded.

If a data member from the base class is directly accessible through the member functions any derived classes, but is not publicly available to users of the type, that data member must be declared under which access specifier?

Q2

QInheritance Pt 1, Q2

This question is ungraded.

If a derived class inherits from the base class with protected inheritance, the public data members and member functions from the base class will:

Q3

QInheritance Pt 1, Q3

This question is ungraded.

It is appropriate to have a derived class inherit from the base class using private inheritance when you:

Q4

QInheritance Pt 1, Q4

This question is ungraded.

Which of the following responses illustrates one way to correctly implement an inheritance scheme in C++?

Q5

QInheritance Pt 1, Q5

This question is ungraded.

To implement an is a relationship amongst objects in our program, we should use what method of inheritance?

Q6

QInheritance Pt 1, Q6

This question is ungraded.

In our lesson, we describe two fundamental but related functions of inheritance. We can define a base class that specifies a set of public member functions that the derived class must implement so that a user can use the derived typed objects through the interface provided by the base type. What function of inheritance is this?

Q7

QInheritance Pt 1, Q7

This question is ungraded.

In our lesson, we describe two fundamental but related functions of inheritance. When we define a base class that provides facilities (data members and member functions) to the derived type, what inheritance function are we applying?