The number in parentheses at the end of an exercise refers to the learning objective listed at the beginning of the chapter.
Mark the following statements as true or false.
a. Division by zero is an exception while opening an input file that does not exist is not an exception. (1)
b. Suppose you use the assert function to check if certain conditions are met. If the conditions are not met, then the assert function terminates the program. (2)
c. One way to handle an exception is to print an error message and exit the program. (2)
d. All exceptions need to be reported to avoid compilation errors. (2)
e. Every try block must have a catch block. (3)
f. The order in which catch blocks are listed is not important. (3)
g. If an exception is thrown in a try block, the remaining statements in that try block are executed after executing a catch block. (3)
h. In C++, an exception is a value. (3)
i. The class invalid_range deals with the string subscript out_of_range error. (5)
j. In C++, any class can be considered an exception class. (6)
k. The exception class must contain at least one member. (6)
l. An exception can be caught either in the function where it occurred, or in any of the functions that led to the invocation of the method. (7)
m. When the function call stack is unwound, the function in which the exception was not caught terminates, but the memory for its local variables remains allocated. (9)
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.