Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. When prompted by the IDE for an encountered exception, you can click the __________ button to pause the program at the line where the

1. When prompted by the IDE for an encountered exception, you can click the __________ button to pause the program at the line where the exception occurred. (2.5 Points)

A. Break. B. Continue. C. Pause. D. Run

2. When an exception occurs, several details are made available in the exception object generated, including the exceptions class name, the path of execution, and an error message. This information is collectively known as a(n): (2.5 Points)

A. object. B. stack trace. C. exception. D. stack overflow.

3. All exception types in the .NET Framework are derived from the __________ class. (2.5 Points) A. Exception B. System C. DivideByZero D. SystemException

4. In your applications, you can choose to rethrow an error, which is the process of capturing an error, processing it accordingly, but then sending an error back to the calling method for further processing. This is performed by using the __________ keyword. (2.5 Points) A. triage B. log C. break D. throw

5. Which of the following statements is FALSE? (2.5 Points) A. A finally block, if there is one, is placed after the last catch block. B. A finally block should release all resources acquired in the corresponding try block. C. The finally block and try block can appear in any order. D. A finally block is optional.

6. When creating user-defined exception classes for custom exception handling, you should always derive from the System __________ class. (2.5 Points) A. Exception B. System C. DivideByZero D. SystemException

7. According to the flow of control for exceptions, if the following try block throws an error by attempting to divide by zero, which of the following values will be written to the console? try { \\ some algorithm here Console.WriteLine ("A"); } catch (FormatException formatException) { Console.WriteLine ("B"); } catch (DivideByZeroException divByZeroExc) { Console.WriteLine ("C"); } catch (Exception e) { Console.WriteLine ("D"); } (2.5 Points) A. "A" B. "B" C. "C" D. "D"

8. The process called exception __________ enables you to create applications that can handle exceptions. (2.5 Points) A. throwing B. handling C. catching D. typing

9. A try/catch statement can have several catch blocks. You can choose to not specify a specific type of exception in a catch, which is known as a(n) __________ catch clause. (2.5 Points) A. general B. exception C. try D. finally

10. In programming speak, when an error is encountered and an exception occurs, it is said to be: (2.5 Points) A. thrown. B. caught. C. tethered. D. final.

11. Which of the following statements about try blocks is TRUE? (2.5 Points) A. The try block must be followed by at least one catch block. B. The try block must be followed by a finally block. C. The try block should contain statements that may process an exception. D. The try block should contain statements that may throw an exception.

12. In order to tell the user what happened in an exception you MUST: (2.5 Points) A. pop the exception. B. toss the exception. C. access Exception properties. D. throw the exception.

13. If a programmer needs to convert a string value to a numeric value, such as an integer, the generally preferred way to do this is to use the integer's __________ method. (2.5 Points) A. TryParse B. TryInt C. Try D. Swap

14. An application will terminate if it encounters a(n) __________ exception. (2.5 Points) A. system B. handled C. unhandled D. DivideByZero

15. An exception object has several properties, including the __________ property, which provides the location of a help file relevant to the particular exception. (2.5 Points) A. HelpLink B. InnerException C. Source D. TargetSite

16. If an exception is thrown in a catch handler, any code in the handler that follows the thrown exception will: (2.5 Points) A. generate a syntax error. B. generate a logic error. C. never be executed. D. run after the finally block is done.

17. According to the flow of control for exceptions, if the following try block throws an error by attempting to divide by zero, which of the following values will be written to the console? try { Console.WriteLine ("A"); } catch (Exception e) { Console.WriteLine ("B"); } catch (DivideByZeroException divByZeroExc) { Console.WriteLine ("C"); } catch (FormatException formatException) { Console.WriteLine ("D"); } (2.5 Points) A. "A" B. "B" C. "C" D. "D"

18. In your applications, you can choose to __________ an error, which will provide an exception to the compiler to indicate that a problem occurred. (2.5 Points) A. triage B. log C. break D. throw

19. An exception object has several properties, including the __________ property, which specifies the method where the exception originated. (2.5 Points) A. HelpLink B. InnerException C. Source D. TargetSite

20. Which of the following statements about try blocks is TRUE? (2.5 Points) A. The try block must be followed by at least one catch block. B. The try block must be followed by a finally block. C. The try block should contain statements that may process an exception. D. The try block should contain statements that may throw an exception.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Harness The Power Of Big Data The IBM Big Data Platform

Authors: Paul Zikopoulos, David Corrigan James Giles Thomas Deutsch Krishnan Parasuraman Dirk DeRoos Paul Zikopoulos

1st Edition

0071808183, 9780071808187

More Books

Students also viewed these Databases questions