COSC-1437 Final Review Chapter 15

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

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. access specification

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. may

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. member functions

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. ambiguous

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. None of these

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. None of these

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. None of these

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

a. base, derived

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. inheritance

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. multiple inheritance

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. private

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. virtual

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. base class members

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

b. derived, base

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. inheritance

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

b. polymorphism

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. overridden

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. override

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. polymorphism

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

c. private members

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. static binding

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

d. virtual

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. virtual function

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. Car

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. Vehicle

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

d. dynamic binding


Set pelajaran terkait

Exam #2 (CH 42 - Patients With Musculoskeletal Disorders)

View Set

Regulation of respiration - chapter 42 guyton

View Set

PNE193-Unit 3 Exam (Abuse, GI/Endocrine, Genitourinary, Musculoskeletal, and Integumentary Disorders, Communicable Diseases)

View Set

PEDIATRIC SUCCESS GENITOURINARY DISORDERS CHAPTER 9

View Set

Unit 7 Test Answers and Questions

View Set

Human Growth and Development Unit 7 Review

View Set