Exam 15: Inheritance
Exam 1: Introduction to Computer and C++ Programming56 Questions
Exam 2: C++ Basics57 Questions
Exam 3: More Flow of Control45 Questions
Exam 4: Procedural Abstraction and Functions That Return a Value53 Questions
Exam 5: Functions for All Sub Tasks54 Questions
Exam 6: Io Streams As an Introduction to Objects and Classes52 Questions
Exam 7: Arrays48 Questions
Exam 8: Strings and Vectors69 Questions
Exam 9: Pointers and Dynamic Arrays39 Questions
Exam 10: Defining Classes61 Questions
Exam 11: Friends, Overloaded Operators, and Arrays in Classes56 Questions
Exam 12: Separate Compilation and Namespaces41 Questions
Exam 13: Pointers and Linked Lists64 Questions
Exam 14: Recursion48 Questions
Exam 15: Inheritance53 Questions
Exam 16: Exception Handling47 Questions
Exam 17: Templates35 Questions
Exam 18: Standard Template Library59 Questions
Select questions type
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)
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)
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)
Showing 41 - 53 of 53
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)