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
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