Filters
Question type

Study Flashcards

The exit() function requires a(n) ____ argument.


A) string
B) void
C) integer
D) double

Correct Answer

verifed

verified

In Visual C++, ____ is interpreted the same as throw(...) .


A) throw(exception e)
B) throw()
C) throw(void)
D) throw( type )

Correct Answer

verifed

verified

If you want a catch block to execute, it must catch the correct type of argument thrown from a try block.

Correct Answer

verifed

verified

True

The following dataEntry() function will not throw any exceptions: ____


A) int dataEntry() throw()
B) int dataEntry() throw(*)
C) int dataEntry() throw(void)
D) int dataEntry()

Correct Answer

verifed

verified

In ANSI C++, if a function throws an error whose type was not listed in its exception specification, then it will produce a run-time error called a(n) ____ exception, and abort the program.


A) default
B) unspecified
C) virtual
D) unexpected

Correct Answer

verifed

verified

D

Explain what the following statement means: "When creating a class to hold an exception, be careful not to create an instantiation that results in the same problem as the original error did".

Correct Answer

verifed

verified

When creating a class to hold an excepti...

View Answer

If you include an exception specification list with a function, and code a throw type that is not listed, the program will not compile.

Correct Answer

verifed

verified

Calling functions from within ____ blocks can be dangerous, especially if you call the function that caused the thrown exception in the first place.


A) try
B) throw
C) catch
D) exception

Correct Answer

verifed

verified

Every function call is a(n) ____.


A) message
B) exception
C) abstraction
D) object

Correct Answer

verifed

verified

A

A function can make multiple throws.

Correct Answer

verifed

verified

When would you want to use a default exception handler?

Correct Answer

verifed

verified

You might want to code a default catch b...

View Answer

A(n) ____ resembles a return statement in a function, except that the execution of the program does not continue from where the function was called.


A) try
B) catch
C) throw
D) exit()

Correct Answer

verifed

verified

Match each term with the correct statement below.

Premises
catches any type of object not previously caught
Responses
catch block
message
exit() function
exception specification
exception
exception handling
exception class
default exception handler
try block

Correct Answer

catch block
message
exit() function
exception specification
exception
exception handling
exception class
default exception handler
try block

The general principle underlying good object-oriented error handling is that any called function should check for errors and handle an error if one is found.

Correct Answer

verifed

verified

As with a try block, a catch block must contain ____________________, even if they surround only one statement.

Correct Answer

verifed

verified

Match each term with the correct statement below.

Premises
declaration of a function's possible throw types
Responses
default exception handler
catch block
message
exception class
try block
exception
exception handling
exception specification
exit() function

Correct Answer

default exception handler
catch block
message
exception class
try block
exception
exception handling
exception specification
exit() function

To handle a thrown object, you include one or more ____ blocks in your program immediately following a try block.


A) exit
B) catch
C) throw

Correct Answer

verifed

verified

If a function does not catch a thrown exception, then a function that calls that function can still catch the exception. This process is called ____.


A) unwinding the stack
B) specifying exceptions
C) exception handling
D) throwing an exception

Correct Answer

verifed

verified

Why was the set_new_handler() function introduced in C++?

Correct Answer

verifed

verified

Recall from Chapter 9 that you can use t...

View Answer

Match each term with the correct statement below.

Premises
set of object-oriented techniques used to manage execution-time errors
Responses
exception class
catch block
exception specification
exit() function
exception handling
try block
message
exception
default exception handler

Correct Answer

exception class
catch block
exception specification
exit() function
exception handling
try block
message
exception
default exception handler

Showing 1 - 20 of 51

Related Exams

Show Answer