Exam 15: Inheritance
Exam 1: Introduction to Computer and C Programming55 Questions
Exam 2: C++ Basics54 Questions
Exam 3: More Flow of Control44 Questions
Exam 4: Procedural Abstraction and Functions That Return a Value51 Questions
Exam 5: Functions for All Sub Tasks53 Questions
Exam 6: Io Streams As an Introduction to Objects and Classes51 Questions
Exam 7: Arrays34 Questions
Exam 8: Strings and Vectors63 Questions
Exam 9: Pointers and Dynamic Arrays40 Questions
Exam 10: Defining Classes50 Questions
Exam 11: Friends, overloaded Operators, and Arrays in Classes49 Questions
Exam 12: Separate Compilation and Namespaces38 Questions
Exam 13: Pointers and Linked Lists51 Questions
Exam 14: Recursion43 Questions
Exam 15: Inheritance53 Questions
Exam 16: Exception Handling47 Questions
Exam 17: Templates33 Questions
Exam 18: Standard Template Library57 Questions
Select questions type
If the member variables in a base class are marked as private,can a derived class directly access those variables?
Free
(Short Answer)
4.8/5
(40)
Correct Answer:
No
If a base class has a public member function,and the derived class has a member function with the same name,but with a different parameter list,this function is said to be
Free
(Multiple Choice)
4.8/5
(31)
Correct Answer:
A
What is another name for a child class?
Free
(Multiple Choice)
4.9/5
(40)
Correct Answer:
D
Give a base class with at least one public member function,how many classes can redefine that member function?
(Multiple Choice)
4.9/5
(36)
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.8/5
(38)
The copy constructor from the base class is not inherited into the derived class.
(True/False)
4.9/5
(41)
The ability to associate multiple meanings to one function name using dynamic binding is called _________.
(Short Answer)
4.7/5
(36)
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
(41)
If you have a copy constructor in the base class,but do not have a copy constructor for the derived class,then
(Multiple Choice)
4.9/5
(49)
The base class has everything that is in the derived class and more
(True/False)
4.9/5
(33)
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.8/5
(44)
A constructor of the base class is ____ inherited in the derived class is/is not)
(Short Answer)
4.8/5
(38)
If you define a function in the derived class that has the same function signature as a function in the base class,this is known as
(Multiple Choice)
4.9/5
(42)
A derived class automatically gets all the member variables from the base class.
(True/False)
5.0/5
(39)
If the member variables of the base class are marked as protected,who can access those variables?
(Essay)
4.9/5
(39)
In order to tell the compiler to wait to decide which version of a function to use,you must precede the function declaration in the base class with the keyword
(Multiple Choice)
4.8/5
(36)
Showing 1 - 20 of 53
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)