Ok, well Ive pretty much finished my program and now all thats left is this error that keeps coming up and I dont know how or where to fix it. The error comes up under the bracket. Iam guess Iam missing a bracket at the end, but when I put one there, then a lot of errors all over the code come up. Can anyone help?
Heres my code,
import java.util.*;
public class Sizes {
public static void main(String[] args) { //This is where the error comes up, Under the bracket//
public static void menu(Scanner kbd, int height, int weight, int age)
{
int choice=0, answer, Y, N;
System.out.print("1. Calculate Hat Size");
System.out.print("2. Calculate Jacket Size");
System.out.print("3. Calculate Waist Size");
System.out.print("4. No More Calculations");
System.out.println("Make a choice:");
choice = kbd.nextInt();
if (choice == 1)
{
displayHat(weight, height);
}
else
if (choice == 2)
{
displayJacket(weight, height);
}
else
if (choice == 3)
{
displayWaist(weight);
}
else
if (choice == 4)
{
System.out.println("Is there another person for which to calculate sizes?" + " " + "(Y/N)");
answer = kbd.nextInt();
if(answer == Y)
{
menu(kbd, height, weight, age);
}
else
if (answer == N)
{
System.out.print("Thanks");
}
}
}
public static void getData()
{
Scanner kbd = new Scanner(System.in);
int height, weight, age;
System.out.println("Enter your height (in inches):");
height = kbd.nextInt();
System.out.println("Enter your weight (in pounds):");
weight = kbd.nextInt();
System.out.println("Enter your age (in years):");
age = kbd.nextInt();
menu(kbd, height, weight, age);
}
public static double hatSize (int weight, int height)
{
return weight/height * 2.9;
}
public static void displayHat (int weight, int height)
{
System.out.println("Your hat size is: " + hatSize(weight,height));
}
public static double jacketSize (int weight, int height)
{
return weight * height / 288;;
}
public static void displayJacket (int weight, int height)
{
System.out.println("Your jacket size is: " + jacketSize(weight,height));
}
public static double waistSize (int weight)
{
return weight / 5.7;;
}
public static void displayWaist (int weight)
{
System.out.println("Your jacket size is: " + waistSize(weight));
}
}
P.S. Iam sorry I havent put any code-tags. I dont know how.