// The "Trap" class.
import java.awt.*;

public class Trap
{

    static double checkDouble (double a)
	//trap user for incorrect type of input
    {
	String trap;

	while (true)
	{
	    try // try to convert string to double
	    {
		trap = c.readLine ();
		a = Double.parseDouble (trap);

		break;
	    }

	    catch (NumberFormatException e)  // if can't, display error message
	    {
		c.println ("Incorrect input, please enter again");
	    }

	}

	return a;

    }

}
