Exam 10: Understanding Inheritance

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

____ data and functions can be accessed only within a class.

(Multiple Choice)
4.8/5
(42)

____ is based on the principle that knowledge of a general category can be applied to more specific objects.

(Multiple Choice)
4.8/5
(30)
Match each term with the correct statement below.
Premises:
to substitute one version of the function for another
Responses:
virtual
invoke a method
override (a function)
Correct Answer:
Verified
Premises:
Responses:
to substitute one version of the function for another
virtual
(Matching)
4.8/5
(29)

When a child class function overrides a parent class function, you can say that you have ____________________ the function.

(Short Answer)
4.7/5
(35)

If you do not use an access specifier when you create a derived class, access is ____________________ by default.

(Short Answer)
4.8/5
(34)

The three access specifiers available for class members in C++ are: public , private and ____.

(Multiple Choice)
4.9/5
(33)

____________________ in C++ means you can create classes that derive their attributes from existing classes.

(Short Answer)
4.9/5
(49)

Any child class function with the same name as the parent, yet with an argument list that differs from the parent's, ____ the parent function.

(Multiple Choice)
4.9/5
(43)

Overriding a base class member function with a derived member function demonstrates the concept of ____.

(Multiple Choice)
4.9/5
(40)

____ data and functions can be accessed only by class functions, or by functions in child classes.

(Multiple Choice)
4.8/5
(43)
Match each term with the correct statement below.
Premises:
class from which another is derived
Responses:
virtual
multiple inheritance
single inheritance
Correct Answer:
Verified
Premises:
Responses:
class from which another is derived
virtual
(Matching)
4.8/5
(47)

When you instantiate a class object that has been derived from another class, ____.

(Multiple Choice)
4.9/5
(32)

The ____ access specifier allows members to be used by class member functions and by derived classes, but not by other parts of a program.

(Multiple Choice)
4.8/5
(46)

Multiple inheritance is ____ required.

(Multiple Choice)
4.8/5
(43)

A(n) ____________________ class is also called the superclass, or ancestor.

(Essay)
4.8/5
(37)

No matter which access specifier you use when creating a child class, access to parent class members never becomes more lenient than originally coded.

(True/False)
4.9/5
(35)

A(n) ____ is a very specific instance of a class.

(Multiple Choice)
5.0/5
(37)

When a derived class object is destroyed, the ____________________ class destructor is called first.

(Short Answer)
4.7/5
(31)

The following code is an example of the correct use of the virtual keyword (assume Student is a subclass of Person ): ____.

(Multiple Choice)
4.8/5
(31)

Consider the following code fragments: class PetStoreItem { protected: int stockNum; double price; public: PetStoreItem(int, double); }; class PetStoreAnimal : public PetStoreItem { protected: int petAge; public: PetStoreAnimal(int); }; PetStoreAnimal::PetStoreAnimal(int age) { petAge = age; } Change the PetStoreAnimal constructor to avoid getting an error.

(Essay)
4.8/5
(39)
Showing 21 - 40 of 53
close modal

Filters

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