import java.util.Scanner; public class ExceptionTestProgram3 { public static void main(String[] args) { int number1 = 0, number2 = 0, result = 0; Scanner keyboard; keyboard = new Scanner(System.in); try { System.out.println("Enter the first number:"); number1 = keyboard.nextInt(); System.out.println("Enter the second number:"); number2 = keyboard.nextInt(); result = number1 / number2; } catch (java.util.InputMismatchException e) { System.out.println("Invalid integer entered!"); System.exit(-1); } catch (ArithmeticException e) { System.out.println("Second number is 0, cannot do division!"); System.exit(-1); } System.out.print(number2 + " goes into " + number1); System.out.println(" this many times: " + result); } }