import java.util.Scanner;

/**
 * Exercise 2.1 from the book Introduction to Java Programming (10th).
 * <p>
 *
 * @author Henrik Samuelsson, henrik.samuelsson(at)gmail.com
 */

public class Exercise_02_02 {

	public static void main(String[] args) {
		double radius;
		double length;
		double area;
		double volume;
		
		// get input from user
		Scanner input = new Scanner(System.in);
		System.out.print("Enter the radius and length of a cylinder: ");
		radius = input.nextDouble();
		length = input.nextDouble();
		
		// calculate area and volume
		area = radius * radius * Math.PI;
		volume = area * length;
		
		// present result
		System.out.println("The area is " + area);
		System.out.println("The volume is " + volume);
	}

}

@@ -38,17 +38,17 @@
 rcise 2.
-1
+2
  from th
@@ -102,14 +102,8 @@
 %0A * 
-%3Cp%3E%0A *
 %0A * 
@@ -619,14 +619,19 @@
 ent 
+the 
 result
+s
 %0A%09%09S

Edit of Exercise 2.2.