import java.util.Scanner; public class Crash2 { public static void main(String[] args) { Scanner in = new Scanner(System.in); int prev=10; while (prev>=0) { System.out.print("Enter a number: "); try { String line = in.nextLine(); int data = Integer.parseInt(line); System.out.println(data + " / " + prev + " = " + (data / prev)); prev=data; } catch(NumberFormatException e) { System.out.println("That's not a number!"); } catch (ArithmeticException ae) { System.err.println("MATH Problem " + ae.toString()); } } in.close(); } }