import junit.framework.Assert;
import junit.framework.AssertionFailedError;
import Prog1Tools.IOTools;

public class AssertionTest {
  
  public static double kehrwert (double x) {
    Assert.assertTrue("/ by 0", x != 0);
    return 1 / x;
  }
  
  public static void main(String[] summand) {
    double x = IOTools.readDouble("x = ");
    try {
      System.out.println (kehrwert(x));
    }
    catch(AssertionFailedError e) {
      System.err.println(e.getMessage());
    }      
  }     
}