import java.util.*; // given the radius and height of a cylinder, compute its volume public class Prog2_2 { public static void main(String[] args) { Scanner in = new Scanner(System.in); // keyboard input double area, radius, volume, height; System.out.print("Enter the height of the cylinder: "); // prompt user for input height = in.nextDouble(); System.out.print("Enter the radius of the cylinder: "); radius = in.nextDouble(); area = Math.PI * radius * radius; // compute area and volume volume = area * height; System.out.printf("The volume of the cylinder is %8.2f", volume); // format the output to restrict number of decimal points } }