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 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.8/5
(39)
A constructor of the base class is ____ inherited in the derived class is/is not)
(Short Answer)
4.9/5
(45)
All member functions in a base class should be listed as virtual functions.
(True/False)
4.7/5
(32)
Which of the following would correctly call the base class BaseClass) assignment operator from the derived class DerivedClass) assignment operator?
DerivedClass& DerivedClass::operator =const DerivedClass& rightSide)
{
//what goes here?
}
(Multiple Choice)
4.8/5
(48)
The derived class may define variables and member functions other than those that are in the base class.
(True/False)
4.8/5
(40)
Give a base class with at least one public member function, how many classes can redefine that member function?
(Multiple Choice)
4.8/5
(33)
Which is the correct way to tell the compiler that the class being declared ChildClass) is derived from the base class BaseClass)?
(Multiple Choice)
4.9/5
(37)
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
(39)
When the derived class gets all the member variables from the base class, we say that they are _________ from the base class.
(Short Answer)
4.9/5
(31)
If two functions in the same scope) have the same name, but a different function signature, this means that the functions are __________.
(Short Answer)
4.8/5
(33)
Given the following simplified classes,
Class Pet
{
Public:
Virtual void print);
String name;
Private:
};
Class Dog: public Pet
{
Public:
Void print);
String breed;
};
Dog vDog;
Pet vPet;
VDog.name="rover";
VDog.breed = "Collie";
Which of the following statements are not legal?
(Multiple Choice)
4.8/5
(33)
A derived class automatically gets all the member variables from the base class.
(True/False)
4.9/5
(41)
If you have the following class definitions, which of the following is the proper way to construct an object of the derived class?
Class Pet
{
Public:
Pet);
Void printPet);
String getName);
Void setNamestring newName);
Private:
String name;
};
Class Dog:public Pet
{
Public:
Dog);
Void printPet);
Void setTypestring newType);
String getType);
Private:
String type;
};
(Multiple Choice)
4.8/5
(43)
If the member variables in a base class are marked as private, can a derived class directly access those variables?
(Short Answer)
4.9/5
(39)
Showing 21 - 40 of 53
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)