import java.util.Scanner;

/**
 * A program that demonstrates reading in from the console, using calculating
 * the area of a rectangle as the example.
 * 
 * @author Sara Sprenkle
 */
public class ScannerDemoRectangle {

	/**
	 * @param args
	 *            not used in this program
	 */
	public static void main(String[] args) {

		// Create the Scanner object, passing in the console input System.in
		Scanner scanner = new Scanner(System.in);

		scanner.useDelimiter("\n"); // breaks up by lines, useful for console I/O

		System.out.print("Please enter the width of a rectangle (an int): ");
		int width = scanner.nextInt();

		System.out.print("Please enter the height of a rectangle (a double): ");
		double length = scanner.nextDouble();

		System.out.println("The area of your rectangle is " + length * width + ".");
	}
}
