// Page 088 // modified: read value from keyboard import java.util.Scanner; class Prog_7_0m { public static void main(String[] args) { Scanner input = new Scanner(System.in); // prompt System.out.print("Input a value: "); double aVal = input.nextDouble(); double myResult; myResult = Square(aVal); // method call System.out.println("Square of "+aVal+" is "+myResult); myResult = Half(aVal); // method call System.out.println("Half of "+aVal+" is "+myResult); } // ----------------------------------- private static double Square(double s) { return s*s; } // ----------------------------------- private static double Half(double n) { return n/2.0; } }