public class W05N01 { public static void main(String[] args) { // Math.abs() example double d1 = IO.readDouble("Your number: "); System.out.println("absolute value of d is " + Math.abs(d1)); // Math.pow() example double d2 = IO.readDouble("Your number: "); double d3 = IO.readDouble("Your number: "); System.out.println("result = " + Math.pow(4 * d1, d2)/d3); } // Here is a local method that does what Math.abs() does public static double abs(double d) { double retVal = d; if (d < 0) retVal = -d; return retVal; } }