import java.io.*;
class eq1_err  {
  // A fourth  Java version to compute 'ax+b = 0'
  static PrintWriter   jout = new PrintWriter(System.out, true);
  static PrintWriter   jerr = new PrintWriter(System.err, true);
  static BufferedReader jin = new BufferedReader(new InputStreamReader(System.in));

  public static void main(String [] args)  {
    double a, b;
   
    jout.print("eq1_err: Solving 'ax+b=0' with NumberFormatException -(c) ~/2A 2002.11.04 17H55\n");
    try   {
      if (args.length == 0)  {
        jout.println("Under normal use, type:   java  eq1_err   value_a  value_b !");
        jout.println("Enter  a  and  b ('aaa'  or  'bbb' to throw an exception)  :");
        a = Double.parseDouble(jin.readLine());
        b = Double.parseDouble(jin.readLine());
      }
      else   {
        a = Double.parseDouble(args[0]);
        b = Double.parseDouble(args[1]);
      }
        jout.println("Solution x = "+ (-b)/a +'\n');

    }
    catch (IOException ioe)  {
        jerr.println("IOException warning : " + ioe.getMessage() +" !");
        jerr.println("Stack : "); ioe.printStackTrace();

    }
    catch (NumberFormatException nfe)  {
        jerr.println("NumberFormatException warning : " + nfe.getMessage() +" !");
        jerr.println("Stack : "); nfe.printStackTrace();
        jerr.println("\nBy default, a = 0.0  and b = -1.0 !");
        a = 0d;   b= -1d;
        jerr.println("By default x = "+ (-b)/a +'\n');
    }
    finally  {
        jout.println("Done !");
    }
    es.attente();
  }
}
