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 ConsoleUsingScannerDemo {

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

		// open the Scanner on the console input, System.in
		Scanner scan = new Scanner(System.in);

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

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

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

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