import java.util.Scanner; public class ExceptionTestProgram2 { public static void main(String[] args) { int number1 = 0, number2 = 0, result; 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(); } catch (java.util.InputMismatchException e) { System.out.println("Those were not proper integers! I quit!"); System.exit(-1); } System.out.print(number2 + " goes into " + number1); System.out.print(" this many times: "); result = number1 / number2; System.out.println(result); } }