Exam 11: Inheritance and Composition
Exam 1: An Overview of Computers and Programming Languages40 Questions
Exam 2: Basic Elements of C++50 Questions
Exam 3: Inputoutput40 Questions
Exam 4: Control Structures I Selection40 Questions
Exam 5: Control Structures II Repetition40 Questions
Exam 6: User-Defined Function41 Questions
Exam 7: Namespaces, the Class String, and User-Defined Simple Data Types40 Questions
Exam 8: Arrays40 Questions
Exam 9: Records Structs40 Questions
Exam 10: Classes and Data Abstraction43 Questions
Exam 11: Inheritance and Composition41 Questions
Exam 12: Pointers, Classes, Virtual Functions, and Abstract Classes43 Questions
Exam 13: Overloading and Templates41 Questions
Exam 14: Exception Handling42 Questions
Exam 15: Recursion41 Questions
Exam 16: Searching and Sorting46 Questions
Exam 17: Linked Lists41 Questions
Exam 18: Stacks and Queues42 Questions
Select questions type
To ____ a public member function of a base class in the derived class, the corresponding function in the derived class must have the same name, number, and types of parameters.
Free
(Multiple Choice)
4.8/5
(40)
Correct Answer:
A
C++ provides ____ functions as a means to implement polymorphism in an inheritance hierarchy, which allows the run-time selection of appropriate member functions.
Free
(Multiple Choice)
4.7/5
(43)
Correct Answer:
C
A derived class cannot directly access public members of a base class.
Free
(True/False)
4.7/5
(34)
Correct Answer:
False
In protected inheritance, public and protected members of the base class become the protected members of the derived class.
(True/False)
4.9/5
(33)
The new classes that we create from existing classes are called ____ classes.
(Multiple Choice)
4.8/5
(27)
The constructor of a derived class cannot directly access the ____________________ member variables of the base class.
(Short Answer)
4.8/5
(36)
Which of the following class definitions makes the public members of the class aClass become the public members of the class bClass?
(Multiple Choice)
4.8/5
(29)
Consider the following class definition: The class dClass is derived from the class bClass using the ____ type of inheritance.


(Multiple Choice)
4.8/5
(37)
If inheritance is public, all protected members of the base class are ____________________ members of the derived class.
(Short Answer)
4.8/5
(40)
Which of the following statements about inheritance is true if memberAccessSpecifier is protected?
(Multiple Choice)
4.8/5
(33)
A call to the base class's constructor is specified in the heading of the definition of a derived class constructor.
(True/False)
4.9/5
(41)
If the derived class does not override a public member function of the base class, you may specify a call to that public member function by using the name of the function and the appropriate parameter list.
(True/False)
4.9/5
(33)
The constructors of a derived class can (directly) initialize only the (public data) members inherited from the base class of the derived class.
(True/False)
4.9/5
(38)
The private members of a base class can be directly accessed by a derived class.
(True/False)
4.8/5
(39)
C++ provides ____________________ functions as a means to implement polymorphism in an inheritance hierarchy.
(Short Answer)
4.8/5
(37)
If the corresponding functions in the base class and the derived class have the same name but different sets of parameters, then this function is ____ in the derived class.
(Multiple Choice)
4.8/5
(40)
Consider the following class definitions: Which of the following dClass constructor definitions is valid in C++?


(Multiple Choice)
4.9/5
(33)
Which of the following is a valid definition of the derived class bClass?
(Multiple Choice)
5.0/5
(46)
Consider the following class definitions:
Which of the following statements correctly redefines the member function print of bClass?

(Multiple Choice)
4.8/5
(36)
Showing 1 - 20 of 41
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)