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
(42)
Correct Answer:
Verified

D

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

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

B

The function ____ returns a string containing an appropriate message.

Free
(Multiple Choice)
4.9/5
(38)
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
(31)

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

(True/False)
4.8/5
(50)

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

(Multiple Choice)
4.8/5
(39)

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

(Short Answer)
4.9/5
(31)

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

(Multiple Choice)
4.8/5
(42)

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

(Multiple Choice)
4.9/5
(36)

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

(Multiple Choice)
4.9/5
(35)

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

(True/False)
4.8/5
(38)

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
(40)

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

(True/False)
4.9/5
(44)

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

(True/False)
4.8/5
(37)

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
(35)

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
(42)

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

(Short Answer)
4.8/5
(32)

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

(Multiple Choice)
5.0/5
(26)

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

(True/False)
4.8/5
(34)

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

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

Filters

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