# new to java and got 2 errors

• 09-09-2013, 07:45 PM
jangeles323
new to java and got 2 errors
Code:

```import java.util.Scanner; import java.text.DecimalFormat; public class Main {               public static void main(String[] args)         {             double radius;             double circ;             double area;               radius = getRadius();               circ = calcCirc();             area = calcArea();               DecimalFormat fmt = new DecimalFormat ("0.##");             System.out.println("run \n " + "The circumference of the circle is \n" + circ                   + "The area of the circle is \n" + area);           }       public static double getRadius()     {       double radius;       Scanner scan = new Scanner(System.in);       System.out.println("Enter the radius of the circle");       radius = scan.nextDouble();       return radius;     }       public static double calcCirc(Radius)     {           double circ;         double pi;         pi = 3.14159;           circ = 2.0 * rad * pi;         return circ;     }     public static double calcArea(Radius)     {         double area;         double pi;         pi = 3.14159;           area = pi * rad * rad;         return area;     }           }```
and these are the errors

Quote:

Main.java:37: error: <identifier> expected
^
Main.java:47: error: <identifier> expected
^
I am suppose to write a simple program that will calculate the Circumference and Area of a circle using the entered number from the radius. I thought i returned them properly but seem to be stuck with these errors.
• 09-09-2013, 07:48 PM
KevinWorkman
Re: new to java and got 2 errors
You have a single word "Radius" as a parameter. That's not correct syntax.

Recommended reading: Passing Information to a Method or a Constructor (The Java™ Tutorials > Learning the Java Language > Classes and Objects)
• 09-09-2013, 07:49 PM
sehudson
Re: new to java and got 2 errors
You are missing the data type for your Radius variable. Also, keep in mind with java coding conventions, variables are lowercase.
• 09-09-2013, 08:00 PM
jangeles323
Re: new to java and got 2 errors
Okay i fixed my mistakes and its working as it should be. Thank you for your help