/* * This program will will compute the area of a circle, given the radius * entered by the user. * * area = PI * r ^ 2 * * * Where r is the radius. * * Output will be rounded to three places. */ import javax.swing.JOptionPane; class CircleArea{ public static void main(String [] args){ final double PI = 3.14159; String inputForRadius = JOptionPane.showInputDialog("Enter Radius"); double radius = Double.parseDouble(inputForRadius); double area = PI * radius * radius; double circumference = 2.0 * PI * radius; System.out.println("The area of a circle with radius " + radius + " is " + area); System.exit(0); } }