Java! please help!!1
843789Feb 19 2010 — edited Feb 19 2010I am having problem with find the circumferene, i have t use 2*Maths.PI*r but i dont where i should put these.
import javax.swing.JOptionPane;
public class CircumferenceSwing
{
public static void main(String[] args)
{
// declare variables
String radius,
int 2, Math.PI
double circumference, index;
// prompts and get input
System.out.println("\tWelcome to My Circumference Console Calculator");
radius = JOptionPane.showInputDialog(null, "Enter the radius:");
Math.PI = Integer.parseInt(radius);
// calculations
Math.PI = PI / 3.14
index = circumference / Math.pow(Math.PI*r, 2);
// output
JOptionPane.showMessageDialog(null, "The result of the radius is " +
Math.round(index) + ".", "Radius Calculator", JOptionPane.PLAIN_MESSAGE);
}
}