@@ -0,0 +1,1150 @@
+package com.samovich.cop2800.chapter12;%0A%0Aimport javax.swing.*;%0A%0A/**%0A * Filename ExceptionDemo.java%0A * Created by Valery Samovich%0A * Written on 7/8/2016%0A */%0Apublic class ExceptionDemo %7B%0A    public static void main(String%5B%5D args) %7B%0A        // declare fields%0A        int numerator = 0;%0A        int denominator = 0;%0A        int result;%0A        String inputString;%0A%0A        // prompt the user and proceed with calculation%0A        try %7B%0A            inputString = JOptionPane.showInputDialog(null,%0A                    %22Enter a number to be divided%22);%0A            numerator = Integer.parseInt(inputString);%0A            inputString  = JOptionPane.showInputDialog(null,%0A                    %22Enter a number to divide into the first number%22);%0A            denominator = Integer.parseInt(inputString);%0A            result = numerator / denominator;%0A        %7D catch (ArithmeticException exception) %7B%0A            JOptionPane.showMessageDialog(null, exception.getMessage());%0A            result = 0;%0A        %7D%0A%0A        // display the result%0A        JOptionPane.showMessageDialog(null, numerator + %22 / %22 +%0A                denominator + %22%5CnResult is %22 + result);%0A    %7D%0A%7D%0A

Add single exception example