Answer the following questions true (T) or false (F)
1. A program can continue to run after an exception has been thrown and caught.
2. A function uses an exception specification that includes only int, but an exception of type double is thrown. A catch block is provided that catches a double, so things proceed properly.
1. True
Explanation: To see that this is true, consider the following scenario. You are saving a document to a floppy disk, but the floppy drive door is not closed. An exception is thrown. A message sent from the catch statement tells you to close the drive door. You do so. The program (continuing) calls the output routine again to save your document.
2. False
Explanation: Exception specifications specify the exceptions that might be thrown. If an exception is thrown that is not in the specification will cause unexpected() to be called. By default, unexpected() calls terminate(), which by default, calls abort() to terminate the program. At least this is what the standard says, but some compilers do not follow the standard in this regard.
You might also like to view...
Explain the difference between a radial gradient and a linear gradient.
What will be an ideal response?
CSS styles are used to style a list nested within a nav element as a(n) ____________________.
Fill in the blank(s) with the appropriate word(s).