27.5k views
3 votes
// Some circle statistics

public class DebugFour2
{
public static void main(String args[])
{
double radius = 12.6;
System.out.println("Circle statistics");
double area = java.Math.PI * radius * radius;
System.out.println("area is " + area);
double diameter = 2 - radius;
System.out.println("diameter is + diameter);
}
}

User Lesto
by
4.1k points

1 Answer

4 votes

public class DebugFour2

{

public static void main(String args[])

{

double radius = 12.6;

System.out.println("Circle statistics");

double area = Math.PI * radius * radius;

System.out.println("area is " + area);

double diameter = 2 * radius;

System.out.println("diameter is " + diameter);

}

}

First off, I added a double quote to "diameter is ". You didn't have the second double quote. Also, I changed the calculation for diameter. You had 2 - radius. The diameter is actually 2 * radius.

I hope this helps!

User Minnette
by
4.5k points