import javax.swing.*;
import java.text.DecimalFormat;

public class dividebyzeroTest1
{
public static double divide(int s1,int s2) throws dividebyzeroException
{
if(s2==0) throw new dividebyzeroException();
return (double) s1/s2;
}

public static void main(String args[])
      {
         String s;
         double result=0;
         int number1,number2;
         boolean continueloop=true;
         while(continueloop)
         {
         try{
	      number1=Integer.parseInt(
          JOptionPane.showInputDialog("enter an integer number : "));
          number2=Integer.parseInt(
          JOptionPane.showInputDialog("enter a second integer number : "));    
          result=divide(number1,number2);
          continueloop=false;
          JOptionPane.showMessageDialog(null,number1+" / "+number2+" = "+result);
            }
         catch(dividebyzeroException e1)
         {JOptionPane.showMessageDialog(null,e1.toString(),"ERROR",JOptionPane.ERROR_MESSAGE);}
         }  
      }
}
    