exam 3 quizlet for the nerd who need help like me

Ace your homework & exams now with Quizwiz!

The ______ destructor is called before the _______ destructor

derived, base

If an exception is thrown by a member function of a class object, then the class _______ is called.

destructor

The compiler preforms ______ on virtual functions.

dynamic binding

These are used to signal errors or unexpected events that occur while a program is running.

exceptions

When member functions behave differently, depending upon which object performed the call, this is an example of ________

polymorphism

An actual instance of a function is created in memory when the compiler encounters

a call to the template function

The line: virtual double earnings() const = 0; appears in a class definition. You CAN NOT deduce that;

all classes derived from this class will override this method.

Using inheritance allows us to

all of the above: 1. eliminate duplicate code 2. make our classes more modular 3. us polymorphism

Abstract classes

are defined, but the programmer never intends to instance any objects from them.

If a base class has public member functions that are not listed by a derived class, then these functions

are inherited unchanged in the derived class

Which of the following assignments would be a compilation error?

assigning the address of a base class object to a derived class pointer

The ______ constructer is called before the _________ constructer.

base, derived

Which of the following would not be a member function that derived classes Fish, Frog, and Bird should inherit from the base class Animal and then provide their own definitions for so that the function call can be preform polymorphism.

flapWings();

________ allows us to create new classes based on existing classes

inheritance

__________ is commonly used to extend a class, or to give it additional capabilities.

inheritance

When you derive a class from an existing class, you _____ add new data and functions.

may

Polymorphism is when ________ in a class hierarchy perform differently, depending upon which object performs the call.

member functions

Once an exception is thrown, when can control return to the throw point.

never

How much memory is reserved for a function template

none/no memory

Which of the following is not allowed?

objects of abstract classes

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

pointers

The term _______ means the ability to take many forms

polymorphism

_______ members of a base class are accessible to a derived class.

public and protected

The main difference between a virtual function and a pure virtual function is

that a pure virtual function cannot have an implementation.

Which of the following should be virtual if a base class uses dynamic memory allocations?

the destructor

The block of code that checks if an unusual situation or error is called

the try block

The correct order in which an exception is detected and handled is:

try, throw, catch

__________ functions are dynamically bound by the compiler

virtual

A ________ of a base class expects to be overridden in a derived class

virtual function

Polymorphism is implemented via:

virtual functions and dynamic binding

An exception thrown from outside a try block

will cause the program to abort execution

Employee is a base class and HourlyWorker is a derived class, with a redefines non-virtual print function. Given the following statements, will the output of the two print function calls be identical? ePtr =&h; ePtr->print(); ePtr->Employee::print();

yes


Related study sets

Anatomy exam 3 (final exam) 150 question multiple choice, 50 on old (more general) , 100 on new material (9,14,15,16), diagrams (human lab muscles page 26, identify on diagram, their function, general region where its at)

View Set

PARTNERSHIP OPERATIONS- Theories Part I

View Set

Ch 5 innovation - entrepreneurship

View Set

Homeowners Policies Part 1 & 2 & Dwelling

View Set