Exam 11: Inheritance and Composition

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

The class io is the base class of the C++ stream classes istream and ostream.

Free
(True/False)
4.8/5
(46)
Correct Answer:
Verified

False

In ____________________,the derived class is derived from a single base class.

Free
(Short Answer)
4.7/5
(33)
Correct Answer:
Verified

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:
Verified

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)

The ____ members of an object form its external state.

(Multiple Choice)
4.8/5
(44)

In C++,we implement ADT through the use of ____________________.

(Short Answer)
4.9/5
(33)

The ____ members of an object form its internal state.

(Multiple Choice)
4.9/5
(36)

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: \quad void setX(int); \quad void print()const; private: \quad int x; }; Class dClass: public bClass { Public: \quad void setXY(int,int); \quad void print()const; private: \quad Int y; }; Which of the following statements correctly redefines the member function print of bClass?

(Multiple Choice)
5.0/5
(35)

Which of the following is true about a derived class?

(Multiple Choice)
4.8/5
(45)
Showing 1 - 20 of 50
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)