Question: - 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
Get step-by-step solutions from verified subject matter experts
