Exam 10: Understanding Inheritance
Exam 1: An Overview of Object-Oriented Programming and C++55 Questions
Exam 2: Evaluating C Expressions51 Questions
Exam 3: Making Decisions50 Questions
Exam 4: Performing Loops51 Questions
Exam 5: Understanding Arrays, Strings and Pointers55 Questions
Exam 6: Using C++ Functions51 Questions
Exam 7: Using Classes56 Questions
Exam 8: Class Features and Design Issues53 Questions
Exam 9: Understanding Friends and Overloading Operators52 Questions
Exam 10: Understanding Inheritance53 Questions
Exam 11: Using Templates54 Questions
Exam 12: Handling Exceptions51 Questions
Exam 13: Advanced Input and Output55 Questions
Exam 14: Advanced Topics53 Questions
Select questions type
Any child class function with the same name and argument list as the parent ____ the parent function.
Free
(Multiple Choice)
4.9/5
(35)
Correct Answer:
D
What happens if a derived class uses the protected access specifier for inheritance?
Free
(Essay)
4.8/5
(40)
Correct Answer:
If a derived class uses the protected access specifier for inheritance, then the following statements are true:
- Base class members that are public become protected in the derived class.
- Base class members that are protected remain protected in the derived class.
- Base class members that are private are inaccessible in the derived class.,
If a base class contains a function that the derived class should not have, you can create a ____________________ function with the same name in the derived class.
Free
(Essay)
4.7/5
(35)
Correct Answer:
dummy or empty,empty,dummy
C++ programmers usually use the ____ access specifier for inheritance.
(Multiple Choice)
4.8/5
(33)
Match each term with the correct statement below.
Premises:
to call a function
Responses:
parent class
invoke a method
single inheritance
Correct Answer:
Premises:
Responses:
(Matching)
4.8/5
(43)
When you define a derived class, you can insert one of the three class access specifiers just prior to the ____________________ name.
(Short Answer)
5.0/5
(39)
When a class serves as a base class to other classes, all of its members are included when you create an object from a derived class. However, the members of the base class that are ____ are not directly accessible from within the child class functions.
(Multiple Choice)
4.9/5
(38)
Can you create an array of parent class objects and store child class objects in it? What happens when you do this?
(Essay)
4.7/5
(29)
With respect to inheritance, what do generalization and specialization mean?
(Essay)
4.8/5
(30)
The children of a virtual base class cannot be used as a base to another class.
(True/False)
4.8/5
(34)
Provide an example of a situation in which you would want to use inheritance when creating classes.
(Essay)
4.8/5
(37)
When a class is a base class you are required to define data as protected rather than private .
(True/False)
4.8/5
(49)
Match each term with the correct statement below.
Premises:
one that cannot be used from the current location
Responses:
override (a function)
parent class
derived class
Correct Answer:
Premises:
Responses:
(Matching)
4.8/5
(31)
Match each term with the correct statement below.
Premises:
class that is already known to work correctly
Responses:
single inheritance
inaccessible class member
parent class
Correct Answer:
Premises:
Responses:
(Matching)
4.8/5
(30)
To create a class Customer that derives from the class Person , you should use the following syntax:
Class Customer ____ public Person // public may be replaced
// by another class access
// specifier
{
// other statements go here
};
(Multiple Choice)
4.8/5
(45)
Showing 1 - 20 of 53
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)