/* AreaCalculator.java CIS 160 David Klick 2007-10-30 Calculates area given length and width. */ import java.util.Scanner; public class AreaCalculator { public static void main(String[] args) { double length, width, area; Scanner in = new Scanner(System.in); System.out.print("Enter length: "); length = in.nextDouble(); System.out.print("Enter width: "); width = in.nextDouble(); area = calcArea(length, width); System.out.printf("The area is %.2f\n", area); } private static double calcArea(double len, double wid) { double a = len * wid; return a; } }