Right. So I'm working on a program for my class and I've come across an area. I did a search and found a few threads on this problem, but none of them seemed to be able to resolve my problem so here I am. The point of the program is to ask the user what type of question they want answered and to have them provide information. With the information gathered, it calls the proper method that does the calculations.
Here is the error that I'm getting:
Geometry.java:9: error: <identifier> expected
public static void circleArea(radius);
^
Geometry.java:14: error: <identifier> expected
public static void rectangleArea(length, width);
^
Geometry.java:14: error: <identifier> expected
public static void rectangleArea(length, width);
^
Geometry.java:19: error: <identifier> expected
public static void triangleArea(height, base);
^
Geometry.java:19: error: <identifier> expected
public static void triangleArea(height, base);
^
Geometry.java:24: error: <identifier> expected
public static void circleCircumfrence(radius);
^
Geometry.java:29: error: <identifier> expected
public static void rectanglePerimeter(length, width);
^
Geometry.java:29: error: <identifier> expected
public static void rectanglePerimeter(length, width);
^
Geometry.java:34: error: <identifier> expected
public static void trianglePerimeter(side1, side2, side3);
^
Geometry.java:34: error: <identifier> expected
public static void trianglePerimeter(side1, side2, side3);
^
Geometry.java:34: error: <identifier> expected
public static void trianglePerimeter(side1, side2, side3);
^
11 errors
Everything else works and I have my variables defined and what not. Here are the methods created (as per my instructors instructions, the methods are to be as void's):
public static void circleArea(radius);
{
circArea = Math.PI * Math.pow(radius, 2);
return circArea;
}
public static void rectangleArea(length, width);
{
rectArea = (length * width);
return rectArea;
}
public static void triangleArea(height, base);
{
triArea = (.05 * base * height);
return triArea;
}
public static void circleCircumfrence(radius);
{
circCircum = 2 * (Math.PI * radius);
return circCircum;
}
public static void rectanglePerimeter(length, width);
{
rectPeri = (2 * length) + (2 * width);
return rectPeri;
}
public static void trianglePerimeter(side1, side2, side3);
{
triPeri = (side1 + side2 + side3);
return triPeri;
}