1A. Which of the following would be a good reason for using inherited exception
ID: 3693761 • Letter: 1
Question
1A.
Which of the following would be a good reason for using inherited exception classes?
Select one:
a. A base class exception can be passed to an exception parameter of the derived class.
b. A derived class exception can be passed to an exception parameter of the base class.
c. A base class exception parameter can be passed any type of exception.
d. All of these
2A
If a function throws an exception, it must be caught inside that function.
Select one:
True
False
3A
The following catch statement
catch(...)
Select one:
a. is illegal.
b. catches only numeric exceptions.
c. catches all exceptions.
d. should be the first catch block if multiple catch statements are present
4A.
The following catch statement
catch(...)
Select one:
a. is illegal.
b. catches only numeric exceptions.
c. catches all exceptions.
d. should be the first catch block if multiple catch statements are present
5A.
A class that is used for exceptions is declared
Select one:
a. differently from other classes.
b. specialized only for exceptions.
c. may not have objects declared of that class.
d. All of these.
e. None of these.
6A.
A class that is used for exceptions is declared
Select one:
a. differently from other classes.
b. specialized only for exceptions.
c. may not have objects declared of that class.
d. All of these.
e. None of these.
7A.
The block of code that checks if an unusual situation or error occurs is called
Select one:
a. the catch block.
b. the try block.
c. a function.
d. an error block.
8A.
f class A is derived from class B, and a virtual function in class B throws an exception, then the overridden version of that function in class A must
Select one:
a. not throw any exceptions.
b. have an exception specification that is a subset of the exception specification of the base class B.
c. not throw any exceptions that the function in class B might throw.
d. All of these.
9A.
Select one:
a. the 12 will be converted to 12.0.
b. the function will throw an integer exception which is passed to the calling code.
c. the function will cause the program to exit.
d. this code has a syntax error.
10A.
In a try block, the throw statement is always executed.
Select one:
True
False
Explanation / Answer
1A)a
2A)True,in my view when an exception raised immediately we can raise the try and catch blocks.
3A)a
4A)a
5A)b
6A)b
7A)b
8A)b
10A)False,because if the function is not capable of handling exception then it can by simply putting trow clause at the function declaration.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.