Unlock access to all the studying documents.
View Full Document
Copyright Cengage Learning. Powered by Cognero.
1. An exception is an occurrence of an undesirable situation that can be detected during program compilation.
2. One of the typical ways of dealing with exceptions is to use an if statement.
3. The heading of a try block can contain ellipses in place of a parameter.
4. A catch block specifies the type of exception it can catch and immediately terminates the program.
Copyright Cengage Learning. Powered by Cognero.
5. If no exception is thrown in a try block, all catch blocks associated with that try block are ignored.
6. An object that is being thrown cannot be an anonymous object.
7. The order of the catch blocks does not affect the program.
8. 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.
Copyright Cengage Learning. Powered by Cognero.
25. The class ____ is designed to deal with illegal arguments used in a function call.
26. Which of the following classes is derived from the class runtime_error?
27. The class ____ is designed to deal with errors that can be detected only during program execution.
Copyright Cengage Learning. Powered by Cognero.
28. The logic_error and runtime_error classes are defined in the header file ____.
29. Which of the following statements creates a new exception class?
class myClass {} implements exception;
class myExceptionClass {} extends exception;
class myExceptionClass {} throws exception;
30. If you want to include members in your exception class, you typically include the function ____.
31. The general syntax to rethrow an exception caught by a catch block is: ____ (in this case, the same exception is
rethrown).
Copyright Cengage Learning. Powered by Cognero.
35. When an exception is thrown, if the program does not handle the exception, then the function ____ is called to
terminate the program.
36. A(n) ____________________ block specifies the type of exception it can catch and contains an exception handler.
37. The ____________________ of the catch block parameter specifies the type of exception that the catch block can
catch.
38. Throwing an exception is typically done using the ____________________ statement.
39. In C++, throw is a(n) ____________________ word.