#### frank3usc

##### Junior Member
Ok I have to make a program where I give it some formulas and it gives me the answers. Here is the what I have to do Program and here is the program.I have tried some things but it is not working for some reason. I got it working with the radius, now i gotta put in a formula for it to find the area, circumference, and diameter. I am not sure if i put it in the wrong place or what but any help would be appreciated.

/**
*
*
* Created: Mon Jan 27 13:34:56 2003
*
* @author <a href="mailto:Jonathan@DESKTOP"></a>
* @version
*/// Java packages
import javax.swing.JOptionPane;

}

public static void main(String[] args)
{
double area;//in square inches
double diameter;//in inches
double circumference;//in inches
boolean flag=true; //controls the loop

do {
try{
flag=false;
} catch(NumberFormatException e) {

}
} while(flag); //loops until a valid number is parsed

{
double area = Math.PI * Math.pow(radius, 2);
JOptionPane.showMessageDialog(null, "The area of the circle = " + area);
}
{
double diameter = radius * 2;
JOptionPane.showMessageDialog(null, "The diameter of the circle = " + diameter );
}
{
double circumference = 2 * Math.PI * radius;
JOptionPane.showMessageDialog(null, "The circumference of the circle = " + circumference);
}
{
double area = Math.pow(2 * radius, 2);
JOptionPane.showMessageDialog(null, "The minimum area of a square containing this circle = " + area );
}
{ double area = Math.pow(2 * Math.sin(Math.PI / 4), 2);
JOptionPane.showMessageDialog(null, "The maximum area of a square contained in this circle = " + area );
};

It is giving me this compiling error though:
CompileServer output: