Ch 15

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

A virtual function is declared by placing the __________ key word in front of the return type in the base class's function declaration. a. virtual b. private c. public d. protected e. None of these

A

The __________ constructor is called before the __________ constructor. a. base, derived b. derived, base c. public, private d. private, public e. None of these

A

The __________ members of a base class are never accessible to a derived class. a. private b. public c. protected d. All of these e. None of these

A

When a derived class has two or more base classes, the situation is called a. multiple inheritance b. multiplicity c. polymorphism d. encapsulation e. None of these

A

Which is the derived class in the following statement? class Car : protected Vehicle a. Car b. Vehicle c. protected d. There is no way to tell. e. None of these

A

Which of the following is commonly used to extend a class or to give it additional capabilities? a. inheritance b. privacy c. the constructor d. the destructor e. None of these

A

Select all that apply. The base class access specification determines how __________ members in the base class may be accessed by derived classes. a. private b. public c. constructed d. protected e. None of these

A,B,D

Select all that apply. In an inheritance situation, the new class that you create from an existing class is known as the a. derived class b. inheritor c. child class d. parental class e. None of these

A,C

Select all that apply. Which of the following constructors cannot be inherited through constructor inheritance? a. the default constructor b. the virtual constructor c. the move constructor d. the copy constructor e. the grand constructor

A,C,D

In OOP programming, __________ allows you to create new classes based on existing classes. a. polymorphism b. inheritance c. function overloading d. the copy constructor e. None of these

B

Multiple inheritance is when a __________ class has __________ base classes. a. base, no b. derived, two or more c. derived, no d. compound, more than two e. None of these

B

The __________ destructor is called before the __________ destructor. a. base, derived b. derived, base c. public, private d. private, public e. None of these

B

The term __________ means the ability to take many forms. a. inheritance b. polymorphism c. member function d. encapsulation e. None of these

B

What is being protected in the following statement? class Car : protected Vehicle a. derived class functions b. base class members c. derived class data d. future inherited classes e. None of these

B

Which is the base class in the following statement? class Car : public Vehicle a. Car b. Vehicle c. public d. class e. None of these

B

A virtual function is a function that expects to be __________ in a derived class. a. ignored b. called frequently c. overridden d. private e. None of these

C

C++11 introduced the __________ key word to help prevent subtle errors when overriding virtual functions. a. const b. final c. override d. virtual e. None of these

C

Polymorphism is when __________ in a class hierarchy perform differently, depending on which object performs the call. a. base class constructors b. derived class constructors c. member functions d. derived class destructors e. None of these

C

Protected members of a base class are like __________, but they may be accessed by derived classes. a. constructor functions b. static members c. private members d. public members e. None of these

C

When member functions behave differently depending on which object performed the call, this is an example of a. chaos theory b. virtual insubordination c. polymorphism d. encapsulation e. None of these

C

When the compiler binds a member function call with the version of the function that resides in the same class as the call itself, it is considered a. local binding b. safe binding c. static binding d. dynamic binding e. None of these

C

When you derive a class from an existing class, you __________ add new data and functions. a. never b. must c. may d. None of these

C

A __________ of a base class expects to be overridden in a derived class. a. constructor function b. destructor function c. static function d. virtual function e. None of these

D

Multiple inheritance opens the opportunity for a derived class to have ___________ members. a. dynamic b. private c. public d. ambiguous e. None of these

D

The compiler performs __________ on virtual functions. a. local binding b. additional error checking c. static binding d. dynamic binding e. None of these

D

Arguments are passed to the base class by the __________ class __________ function. a. derived, constructor b. derived, destructor c. base, constructor d. base, destructor e. None of these

E

Arguments are passed to the base class destructor by the __________ class __________ function. a. derived, constructor b. derived, destructor c. base, constructor d. base, destructor e. None of these

E

The following statement allows the __________ members of the Car class to access __________ members of the Vehicle class. class Car : public Vehicle a. private, private b. public, private c. protected, private d. public, protected e. None of these

E

When more than one class is derived from a base class, the situation is called a. polymorphism b. multiplicity c. population d. encapsulation e. None of these

E

A derived class may not have any classes derived from it.

F

A member function of a derived class may not have the same name as a member function of a base class.

F

In C++11, using constructor inheritance, it is possible for any of the base class's constructors to be inherited.

F

In an inheritance situation, you may not pass arguments to a base class constructor.

F

A derived class may become a base class if another class is derived from it.

T

C++11 provides a way for a derived class to inherit some of the base class's constructors.

T

In C++11, if a derived class attempts to override a final member function, the compiler generates an error.

T

More than one class may be derived from a base class.

T

Static binding occurs when the compiler binds a function call with the function call that resides in the same class as the call itself.

T

Select all that apply. The base class's __________ affects the way its members are inherited by the derived class. a. name b. return data type c. access specification d. construction e. None of these

C

Functions that are dynamically bound by the compiler are __________ functions. a. constructor b. destructor c. static d. virtual e. None of these

D

Pointers to a base class may be assigned the address of a derived class object.

T

The base class access specification can be viewed as a filter that base class members must pass through when becoming inherited members of a derived class.

T

When arguments must be passed to the base class constructor, they are passed from the derived class constructor's header line.

T


Kaugnay na mga set ng pag-aaral

Chapter 10 : Gastrointestinal Tract - REVIEW QUESTIONS

View Set

Chapter 7- Consumers, Producers, and the Efficiency of Markets

View Set

Ch 11. Boolean Algebra & Logic Gates

View Set

ch 8 quizes and post tests STATS

View Set

Management Chapter 6 (Connect and Notes)

View Set

Oracle CPQ Cloud Service 2017 Implementation Essentials 1z0-976

View Set