Exam 18: Exception Handling
Exam 1: C++ Basics37 Questions
Exam 2: Flow of Control33 Questions
Exam 3: Function Basics30 Questions
Exam 4: Parameters and Overloading31 Questions
Exam 5: Arrays32 Questions
Exam 6: Structures and Classes37 Questions
Exam 7: Constructors and Other Tools32 Questions
Exam 8: Operator Overloading,friends,and References31 Questions
Exam 9: Strings37 Questions
Exam 10: Pointers and Dynamic Arrays29 Questions
Exam 11: Separate Compilation and Namespaces35 Questions
Exam 12: Streams and File IO43 Questions
Exam 13: Recursion40 Questions
Exam 14: Inheritance30 Questions
Exam 15: Polymorphism and Virtual Functions34 Questions
Exam 16: Templates27 Questions
Exam 17: Linked Data Structures30 Questions
Exam 18: Exception Handling29 Questions
Exam 19: Standard Template Library46 Questions
Exam 20: Patterns and Uml22 Questions
Select questions type
When an exception is thrown,the function finishes its execution,its value is returned,then control is transferred to the catch block.
Free
(True/False)
4.7/5
(34)
Correct Answer:
False
A circumstance in C++ where an exception is thrown must be an error.
Free
(True/False)
4.8/5
(35)
Correct Answer:
False
In C++ an exception object must be derived from the exception class defined in the standard library.
Free
(True/False)
4.8/5
(39)
Correct Answer:
False
Write a definition for an exception class,E,that contains an error number and a string type error name.Include a constructor that creates an E object and initializes both members.Provide accessors for both the message and error number.
(Essay)
4.9/5
(35)
The exception specification for a function has no effect on an exception that is caught within the function.
(True/False)
4.8/5
(40)
When an event occurs that cannot be managed locally,an exception may be thrown.Throwing the exception object transfers control and information gleaned locally to some calling program unit that manages the event,or the program terminates.
(True/False)
4.8/5
(42)
Explain how the mechanism for deciding which catch block catches an exception is like the mechanism for deciding which function definition is used when an overloaded function is called.
(Essay)
4.9/5
(46)
If an exception is thrown in a function,say,f(),but not handled there,the exception is propagated to the function that called f().
(True/False)
4.7/5
(39)
Mentioning a base class B in an exception specification includes a class D objects,where D is derived from B,in the exception specification.
(True/False)
4.8/5
(42)
A function does not have an exception specification at all,so exceptions are prohibited.
(True/False)
4.9/5
(36)
Suppose an exception of type E is thrown in a function but not listed in the exception specification,and is not caught in the function.The exception will be caught in a calling function that has a catch block that declares an exception of that type.
(True/False)
4.8/5
(33)
A program can continue to run after an exception has been thrown and caught.
(True/False)
4.9/5
(29)
The context in which an exception is handled (or managed)is the throw block.
(True/False)
4.9/5
(36)
An exception is signaled or raised with the keyword catch followed by an exception object that may be of any C++ type.
(True/False)
4.8/5
(45)
Describe the circumstances that the unexpected()function will be called.
(Essay)
4.8/5
(40)
In C++,an exception object can be a user-defined type or any type that is built-into C++ language.
(True/False)
4.9/5
(28)
Compilers will check code in functions against exception specifications.
(True/False)
4.7/5
(33)
How can you write a catch block that will catch all exceptions that have been thrown but not yet caught?
(Essay)
4.8/5
(40)
Showing 1 - 20 of 29
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)