import javax.swing.*;

public class TryCatchTest
{
	public static void main (String[] args)
	{
		String str1, str2;
		int num1 = 0, num2 = 0, ans = 0;

		str1 = JOptionPane.showInputDialog ("Enter first number");
		str2 = JOptionPane.showInputDialog ("Enter second number");

		try
		{

			num1 = Integer.parseInt (str1);
			num2 = Integer.parseInt (str2);

			//ans = num1 / num2;

			JOptionPane.showMessageDialog (null, "The quotient is " + ans);
		}

		catch (NumberFormatException e)
		{
			JOptionPane.showMessageDialog (null, "you must enter an integer " );
		}

		catch (ArithmeticException e)
		{
			JOptionPane.showMessageDialog (null, "division by zero" );
		}

		System.exit(0);
	}

	public static int divide(int x, int y) throws ArithmeticException
	{
		return x/y;
	}
}