import java.util.Scanner;
/**
* This is the CircleStats program.
*
* @author
* @version
*/
public class CircleStats
{
/**
* Write a one-sentence summary of your main method here.
*/
public static void main(String[] args)
{
Scanner cin = new Scanner(System.in);
System.out.print("Enter the radius of a circle: ");
double radius = cin.nextDouble();
double area = Math.PI * Math.sqrt(radius, 2);
System.out.print("Area :" + area);
double circ = 2 * Math.PI * radius;
System.out.print("Circumference: " + circ);
}
}
When I try to compile it highlights "double area = Math.PI * Math.sqrt(radius, 2);"
and says "java.lang.Math cannot be applied to (double,int)"
so I don't know how I'm suppose to fix that. help please


Sign In
Create Account


Back to top









