// Must import the Scanner because it is not provided by default import java.util.Scanner; // Class name must match the name of the file. Since the // name of our file is 'Area.java', the class name must // be 'Area'. public class Area { public static void main(String[] args) { // Make a scanner so that we can use it to get user input Scanner s = new Scanner(System.in); // Including PROMPTS before using nextDouble() makes the // program more user-friendly System.out.print("Please, enter height: "); double height = s.nextDouble(); System.out.print("Please enter width: "); double width = s.nextDouble(); // Now we can use the entered values to compute and display // the area of a rectangle double area = height * width; System.out.println("Area is " + area); } }