Program Improvement:
The following program performs division and does not throw an exception when you input a zero for the denominator. It also does not detect input number format exceptions. Minimize the total lines of code required to meet the requirements.
/************************************************************** Division2.java* Dean & Dean** This attempts to prevent division by zero.*************************************************************/import java.util.Scanner;public class Division2{public static void main(String[] args){Scanner stdIn = new Scanner(System.in);double n;int d;System.out.print("Enter numerator: ");n = stdIn.nextDouble();System.out.print("Enter divisor: ");d = stdIn.nextInt();System.out.println(n / d);} // end main} // end Division2 classa) First, rewrite the program so that it still employs a
b) Next, rewrite the program of part a so that if the user inputs an improper format for either numerator or denominator, the entire input query repeats until both formats are
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.