Exam 14: Exception Handling

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

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

Free
(Multiple Choice)
5.0/5
(98)
Correct Answer:
Verified

D

To use the assert function in your program, you should include the statement ____.

Free
(Multiple Choice)
4.8/5
(79)
Correct Answer:
Verified

B

The function ____ returns a string containing an appropriate message.

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

B

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

(Multiple Choice)
4.8/5
(81)

A catch block specifies the type of exception it can catch and immediately terminates the program.

(True/False)
4.8/5
(96)

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

(Multiple Choice)
4.8/5
(86)

The class ____________________ deals with the string subscript out of range error.

(Short Answer)
4.9/5
(81)

A(n) ____ is an occurrence of an undesirable situation that can be detected during program execution.

(Multiple Choice)
4.8/5
(86)

The class ____ is designed to deal with errors that can be detected only during program execution.

(Multiple Choice)
4.9/5
(75)

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

(Multiple Choice)
4.8/5
(77)

An object that is being thrown cannot be an anonymous object.

(True/False)
4.8/5
(89)

To deal with logical errors in a program, such as a string subscript out of range or an invalid argument to a function call, several classes are derived from the class ____.

(Multiple Choice)
4.8/5
(80)

An exception is an occurrence of an undesirable situation that can be detected during program compilation.

(True/False)
4.9/5
(88)

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

(True/False)
4.9/5
(86)

When division by zero occurs and the problem is not addressed, the program crashes with an error message that is ____ dependent.

(Multiple Choice)
5.0/5
(86)

Suppose you have written a program that inputs data from a file. If the input file does not exist when the program executes, then you should choose which option?

(Multiple Choice)
4.8/5
(85)

The ____________________ of the catch block parameter specifies the type of exception that the catch block can catch.

(Short Answer)
4.8/5
(77)

The class ____ is the base of the classes designed to handle exceptions.

(Multiple Choice)
5.0/5
(74)

If no exception is thrown in a try block, all catch blocks associated with that try block are ignored.

(True/False)
4.8/5
(79)

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

(Multiple Choice)
4.9/5
(97)
Showing 1 - 20 of 42
close modal

Filters

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