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
____ data and functions can be accessed only within a class.
(Multiple Choice)
4.8/5
(42)
____ is based on the principle that knowledge of a general category can be applied to more specific objects.
(Multiple Choice)
4.8/5
(30)
Match each term with the correct statement below.
Premises:
to substitute one version of the function for another
Responses:
virtual
invoke a method
override (a function)
Correct Answer:
Premises:
Responses:
(Matching)
4.8/5
(29)
When a child class function overrides a parent class function, you can say that you have ____________________ the function.
(Short Answer)
4.7/5
(35)
If you do not use an access specifier when you create a derived class, access is ____________________ by default.
(Short Answer)
4.8/5
(34)
The three access specifiers available for class members in C++ are: public , private and ____.
(Multiple Choice)
4.9/5
(33)
____________________ in C++ means you can create classes that derive their attributes from existing classes.
(Short Answer)
4.9/5
(49)
Any child class function with the same name as the parent, yet with an argument list that differs from the parent's, ____ the parent function.
(Multiple Choice)
4.9/5
(43)
Overriding a base class member function with a derived member function demonstrates the concept of ____.
(Multiple Choice)
4.9/5
(40)
____ data and functions can be accessed only by class functions, or by functions in child classes.
(Multiple Choice)
4.8/5
(43)
Match each term with the correct statement below.
Premises:
class from which another is derived
Responses:
virtual
multiple inheritance
single inheritance
Correct Answer:
Premises:
Responses:
(Matching)
4.8/5
(47)
When you instantiate a class object that has been derived from another class, ____.
(Multiple Choice)
4.9/5
(32)
The ____ access specifier allows members to be used by class member functions and by derived classes, but not by other parts of a program.
(Multiple Choice)
4.8/5
(46)
A(n) ____________________ class is also called the superclass, or ancestor.
(Essay)
4.8/5
(37)
No matter which access specifier you use when creating a child class, access to parent class members never becomes more lenient than originally coded.
(True/False)
4.9/5
(35)
When a derived class object is destroyed, the ____________________ class destructor is called first.
(Short Answer)
4.7/5
(31)
The following code is an example of the correct use of the virtual keyword (assume Student is a subclass of Person ): ____.
(Multiple Choice)
4.8/5
(31)
Consider the following code fragments:
class PetStoreItem
{
protected:
int stockNum;
double price;
public:
PetStoreItem(int, double);
};
class PetStoreAnimal : public PetStoreItem
{
protected:
int petAge;
public:
PetStoreAnimal(int);
};
PetStoreAnimal::PetStoreAnimal(int age)
{
petAge = age;
}
Change the PetStoreAnimal constructor to avoid getting an error.
(Essay)
4.8/5
(39)
Showing 21 - 40 of 53
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)