Question: Use Java Division by Zero Use the following: 1. The division by zero example titled: Zero Revised with the try/catch code. 2. The Division By

Use Java

Division by Zero

Use the following:

1. The division by zero example titled: Zero Revised with the try/catch code. 2. The Division By Zero Exception class

Convert the Zero Revised program to include a loop that will allow the program to recover from a division by zero error by allowing the User to keep entering integers. The program should behave in the following manner:

1. Include a looping structure around the Try/Catch block. 2. Accept input ( the numerator and denominator ) from the User. Be sure to keep the data type of each as integer. 3. Indicate with an error message if there is a division by zero error. 4. Include in the error message a prompt to try again. 5. Loop back up to step 2 if the User wants to try again.

NOTE: 1. Declare all variables within the data declaration section. 2 Do not get input on the same line as a variable declaration. 3. Do not place an equation for computation on the same line as declaring a variable.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!