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
The class io is the base class of the C++ stream classes istream and ostream.
Free
(True/False)
4.8/5
(46)
Correct Answer:
False
In ____________________,the derived class is derived from a single base class.
Free
(Short Answer)
4.7/5
(33)
Correct Answer:
single inheritance
If the derived class does not override a public member function of the base class,you may specify a call to that public member function by using the name of the function and the appropriate parameter list.
Free
(True/False)
4.8/5
(35)
Correct Answer:
True
If the derived class classD overrides a public member function functionName of the base class classB,then to specify a call to that public member function of the base class you use the statement ____.
(Multiple Choice)
4.8/5
(33)
If the corresponding functions in the base class and the derived class have the same name but different sets of parameters,then this function is ____ in the derived class.
(Multiple Choice)
4.9/5
(30)
The private members of a base class can be directly accessed by a derived class.
(True/False)
4.8/5
(36)
The constructors of a derived class can (directly)initialize only the (public data)members inherited from the base class of the derived class.
(True/False)
4.9/5
(35)
Consider the following class definitions:
class bClass
{
Public:
Void set(double a,double b);
//Postcondition: x = a; y = b;
Void print()const;
BClass();
//Postcondition: x = 0; y = 0;
BClass(double a,double b);
//Postcondition: x = a; y = b;
Private:
Double x;
Double y;
};
Class dClass: public bClass
{
Public:
Void set(double a,double b,double c);
//Postcondition: x = a; y = b; z = c;
Void print()const;
DClass();
//Postcondition: x = 0; y = 0; z = 0 ;
DClass(double a,double b,double c);
//Postcondition: x = a; y = b; z = c;
Private:
Double z;
};
Which of the following dClass constructor definitions is valid in C++?
(Multiple Choice)
4.8/5
(43)
A call to the base class's constructor is specified in the heading of the definition of a derived class constructor.
(True/False)
4.8/5
(47)
The constructor of a derived class cannot directly access the ____________________ member variables of the base class.
(Short Answer)
4.8/5
(32)
The OOP terminology is influenced by the vocabulary of ____________________,the OOP language largely developed at a Xerox research center during the 1970s.
(Short Answer)
4.8/5
(32)
Consider the following class definition: class dClass: bClass
{
//class members list
};
The class dClass is derived from the class bClass using the ____ type of inheritance.
(Multiple Choice)
4.7/5
(33)
In C++,we implement ADT through the use of ____________________.
(Short Answer)
4.9/5
(33)
Objects are created when ____________________ variables are declared.
(Short Answer)
4.8/5
(39)
To ____ a public member function of a base class in the derived class,the corresponding function in the derived class must have the same name,number,and types of parameters.
(Multiple Choice)
4.8/5
(41)
____ is the ability to combine data,and operations on that data,in a single unit.
(Multiple Choice)
4.8/5
(39)
Consider the following class definitions:
class bClass
{
public:
void setX(int);
void print()const;
private:
int x;
};
Class dClass: public bClass
{
Public:
void setXY(int,int);
void print()const;
private:
Int y;
};
Which of the following statements correctly redefines the member function print of bClass?
(Multiple Choice)
5.0/5
(35)
Showing 1 - 20 of 50
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)