Filters
Question type

Study Flashcards

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


A) code
B) computer
C) platform
D) IDE

E) A) and B)
F) B) and C)

Correct Answer

verifed

verified

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


A) error
B) exception
C) runtime_error
D) logic_error

E) None of the above
F) B) and D)

Correct Answer

verifed

verified

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

Correct Answer

verifed

verified

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

Correct Answer

verifed

verified

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

A) True
B) False

Correct Answer

verifed

verified

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

A) True
B) False

Correct Answer

verifed

verified

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

A) True
B) False

Correct Answer

verifed

verified

False

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

Correct Answer

verifed

verified

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

Correct Answer

verifed

verified

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.

A) True
B) False

Correct Answer

verifed

verified

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


A) crash
B) exception
C) misfire
D) bug

E) B) and D)
F) A) and D)

Correct Answer

verifed

verified

The string concatenation operator is represented by the ____________________ symbol.

Correct Answer

verifed

verified

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


A) log
B) what
C) terminate
D) close

E) A) and B)
F) All of the above

Correct Answer

verifed

verified

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

A) True
B) False

Correct Answer

verifed

verified

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?


A) Terminate the program.
B) Include code in the program to recover from the exception.
C) Log the error and continue.
D) Include code in the header file.

E) All of the above
F) B) and C)

Correct Answer

verifed

verified

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


A) illegal_argument
B) bad_argument
C) invalid_call
D) invalid_argument

E) B) and D)
F) A) and D)

Correct Answer

verifed

verified

D

Which of the following statements creates a new exception class?


A) class myClass {};
B) class myClass {} implements exception;
C) class myExceptionClass {} extends exception;
D) class myExceptionClass {} throws exception;

E) B) and C)
F) None of the above

Correct Answer

verifed

verified

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


A) that
B) this
C) log
D) what

E) A) and D)
F) C) and D)

Correct Answer

verifed

verified

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


A) throw
B) finally
C) do
D) catch

E) C) and D)
F) B) and D)

Correct Answer

verifed

verified

D

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

Correct Answer

verifed

verified

Showing 1 - 20 of 43

Related Exams

Show Answer