Exam 14: Exception Handling

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

Which of the following classes is derived from the class runtime_error?

Free
(Multiple Choice)
4.9/5
(33)
Correct Answer:
Verified

C

The class ____ is designed to deal with illegal arguments used in a function call.

Free
(Multiple Choice)
4.9/5
(37)
Correct Answer:
Verified

D

If the catch block with an ellipses (in the heading) is needed, then it should be the first catch block in a sequence of try/catch blocks.

Free
(True/False)
4.9/5
(34)
Correct Answer:
Verified

False

The general syntax to rethrow an exception caught by a catch block is: ____ (in this case, the same exception is rethrown).

(Multiple Choice)
4.8/5
(40)

Which of the following statements creates a new exception class?

(Multiple Choice)
4.8/5
(34)

Which of the following options should you choose when an exception occurs in the program that analyzes an airline's ticketing transactions?

(Multiple Choice)
4.9/5
(31)

The statements that may generate an exception are placed in a ____ block.

(Multiple Choice)
4.8/5
(33)

One of the typical ways of dealing with exceptions is to use an if statement.

(True/False)
4.8/5
(48)

The try block is followed by one or more ____ blocks.

(Multiple Choice)
4.8/5
(32)

The code to handle exceptions depends on the type of application you develop.

(True/False)
4.8/5
(34)

The function ____ can check whether an expression meets the required conditions; if the conditions are not met, it terminates the program.

(Multiple Choice)
4.9/5
(41)

C++ provides all the exception classes you will ever need.

(True/False)
4.9/5
(42)

In C++, throw is a(n) ____________________ word.

(Short Answer)
4.9/5
(24)

When an exception occurs in a program, the programmer usually has three choices: ____________________, include code in the program to recover from the exception, or log the error and continue.

(Short Answer)
4.8/5
(39)

When an exception is thrown, if the program does not handle the exception, then the function ____ is called to terminate the program.

(Multiple Choice)
4.9/5
(32)

When an exception is thrown in a function, the function can do the following: ____________________; partially process the exception and throw the same exception or a new exception; or throw a new exception.

(Short Answer)
4.8/5
(33)

A catch block can have, at most, ____ catch block parameter(s).

(Multiple Choice)
4.9/5
(39)

Throwing an exception is typically done using the ____________________ statement.

(Short Answer)
4.7/5
(34)

If you want to include members in your exception class, you typically include the function ____.

(Multiple Choice)
4.9/5
(38)

In a sequence of try/catch blocks, the last catch block of that sequence should be ____.

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

Filters

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