Exam 11: Inheritance and Composition
Exam 1: An Overview of Computers and Programming Languages50 Questions
Exam 2: Basic Elements of C++50 Questions
Exam 3: Input/Output50 Questions
Exam 4: Control Structures I (Selection)50 Questions
Exam 5: Control Structures II (Repetition)50 Questions
Exam 6: User-Defined Functions50 Questions
Exam 7: User-Defined Simple Data Types, Namespaces, and the string Type50 Questions
Exam 8: Arrays and Strings50 Questions
Exam 9: Records (structs)50 Questions
Exam 10: Classes and Data Abstraction50 Questions
Exam 11: Inheritance and Composition50 Questions
Exam 12: Pointers, Classes, Virtual Functions, Abstract Classes, and Lists50 Questions
Exam 13: Overloading and Templates50 Questions
Exam 14: Exception Handling50 Questions
Exam 15: Recursion50 Questions
Exam 16: Linked Lists50 Questions
Exam 17: Stacks and Queues50 Questions
Exam 18: Searching and Sorting Algorithms50 Questions
Exam 19: Binary Trees50 Questions
Exam 20: Graphs50 Questions
Exam 21: Standard Template Library (STL)50 Questions
Select questions type
____ is the ability to use the same expression to denote different operations.
(Multiple Choice)
4.9/5
(33)
In ____________________ (aggregation),one or more members of a class are objects of another class type.
(Short Answer)
4.9/5
(34)
In multiple inheritance,the derived class has more than one base class.
(True/False)
4.9/5
(40)
Suppose that bClass is a class.Which of the following statements correctly derives the class dClass from bClass?
(Multiple Choice)
4.8/5
(35)
The new classes that we create from existing classes are called ____ classes.
(Multiple Choice)
4.9/5
(30)
Classes can create new classes from existing classes.This important feature ____.
(Multiple Choice)
4.9/5
(41)
In object-oriented design,we debug ____________________; in structured programming,we debug functions.
(Short Answer)
4.9/5
(41)
A derived class can directly access the protected members of the base class.
(True/False)
4.8/5
(43)
A derived class cannot directly access public members of a base class.
(True/False)
4.9/5
(39)
Which of the following statements about inheritance is true if memberAccessSpecifier is protected?
(Multiple Choice)
4.8/5
(29)
C++ provides ____________________ functions as a means to implement polymorphism in an inheritance hierarchy.
(Short Answer)
4.8/5
(39)
If inheritance is private,all members of the base class,including private members,become private members of the derived class.
(True/False)
4.7/5
(44)
Which of the following class definitions makes the public members of the class aClass become the public members of the class bClass?
(Multiple Choice)
4.8/5
(35)
The term ____________________ is used to describe the ability to create new objects from existing objects.
(Short Answer)
4.9/5
(37)
Consider the following class definitions: class bClass
{
Public:
Void setX(int a);
//Postcondition: x = a;
Void print()const;
Private:
Int x;
};
Class dClass: public bClass
{
Public:
Void setXY(int a,int b);
//Postcondition: x = a; y = b;
Void print()const;
Private:
Int y;
};
Which of the following correctly sets the values of x and y?
(Multiple Choice)
4.7/5
(34)
In the case of composition,the ____________________ name is used to invoke the constructor.
(Short Answer)
4.9/5
(39)
Showing 21 - 40 of 50
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)