Java Programming Coding Assignment Jgrasp Assignment Focuses Exception Processing Using Tr Q43881549
Java Programming Coding Assignment. JGrasp.
This assignment focuses on exception processing using the try -catch – finally.
- You will modify the TryCatchExample program that is pastedbelow these instructions.
- You will modify the program to input an integer value and adouble value. Each input should display a prompt indicating thetype of data to be input.
- You will include try – catch clauses that will handle thefollowing conditions: invalid integer values was input, aninvalid double value was input, and a divide by zerooperation.
- The code for exception processing should be: invalid integerinput should result in an error message and a prompt for anotherinteger, an invalid double value should result in an error messageand a prompt for another double, and a divide by zero should resultin an error message and the termination of the program.
- All input should be done from the keyboard using a Scannerobject.
**Code**
//***************************************************
//
// Example file for Exception Processing Assignment
//
// Author: Kim Cannon
// Date: 5/14/15
//
//***************************************************
import java.util.Scanner;
public class TryCatchExample {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.print(“Input integer value: “);
int in = input.nextInt();
System.out.println(“Value input was: ” + in);
}
}
Expert Answer
Answer to Java Programming Coding Assignment. JGrasp. This assignment focuses on exception processing using the try – catch – fina…
OR