Here is the code that I wrote out:And here is what is displayed in the command prompt when I compile my code:
//program that calculates the circumference and area of a circle
import java.util.Scanner;
public class circle{
public static void main(String[] args){
Scanner input= new Scanner( System.in);
double r; //declares radius
double A; //declares area
double C; //declares circumference
System.out.print("Entered the radius\n");//prompt
r=input.nextdouble();//entered the radius
A=3.14159*r*r;
C=2*3.14159*r;
System.out.printf("The value of the circumference is %d\n", C); //displays the result for the area
System.out.printf("The value of the area is %d\n", A);
}
}
What am I doing wrongcircle.java:17: error: cannot find symbol
r.input.nextdouble();//entered the radius
symbol: method nextdouble()
location: variable input of type Scanner
1 error