Answered step by step
Verified Expert Solution
Question
1 Approved Answer
- Program must be written in C# You Do It Handling Exceptions You can handle exceptions by placing them in a try block and then
- Program must be written in C#
You Do It Handling Exceptions You can handle exceptions by placing them in a try block and then catching any exceptions that are thrown from it. 1. Open the ExceptionsOnPurpose program if it is not still open. Change the class name to ExceptionsOnPurpose2, and immediately save the project as ExceptionsOnPurpose2 2. In the MainO method, after the three variable declarations, enclose the next three statements in a try block as follows: try WriteC"Enter an integer > answer = Convert.ToInt32(ReadLine()); result = answer / zero; 3. Following the try block (but before the WriteLineO statement that displays answerl, add a catch block that catches any thrown Exception object and displays its Message property: (continues)Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started