Exam 14: Exception Handling

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

Which of the following statements throws a valid exception in C++?

(Multiple Choice)
4.9/5
(38)

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.7/5
(42)

Which of the following blocks is designed to catch any type of exception?

(Multiple Choice)
4.7/5
(46)

The function ____ returns a string containing an appropriate message.

(Multiple Choice)
4.8/5
(34)

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

(True/False)
4.7/5
(35)

If the operator new cannot allocate memory space, this operator throws a(n) ____________________ exception.

(Short Answer)
4.8/5
(35)

The logic_error and runtime_error classes are defined in the header file ____.

(Multiple Choice)
4.8/5
(35)

Which of the following is a valid C++ statement?

(Multiple Choice)
4.8/5
(39)

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

(True/False)
4.8/5
(28)

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.9/5
(33)

If the operator new cannot allocate memory space, this operator throws a(n) ____________________ exception.

(Short Answer)
4.9/5
(26)

The heading of a try block can contain ellipses in place of a parameter.

(True/False)
4.7/5
(39)

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

(Short Answer)
4.8/5
(33)

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

(Multiple Choice)
4.8/5
(46)

All derived classes of the class exception override the function ____________________ to issue their own error messages.

(Short Answer)
4.7/5
(38)

A(n) ____________________ block specifies the type of exception it can catch and contains an exception handler.

(Short Answer)
4.7/5
(37)

When an exception occurs in a try block, control immediately passes to one of the ____________________ blocks.

(Short Answer)
4.8/5
(38)

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

(True/False)
4.7/5
(32)

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

(Short Answer)
4.9/5
(36)

In C++, any class can be considered an exception class.

(True/False)
4.7/5
(35)
Showing 21 - 40 of 50
close modal

Filters

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