I am trying to use the variables from a static method named getBMI:
public static double getBMI(int weightKG, int heightCM)
{
Scanner input = new Scanner(System.in);
// Input Weight
System.out.print("Enter your weight in kilograms: ");
weightKG = input.nextInt();
System.out.println();
// Input Height
System.out.print("Enter your height in centimeters: ");
heightCM = input.nextInt();
System.out.println();
return heightCM;
return weightKG;
}
And use it in another static method named calculateMetricBMI:
public static void calculateMetricBMI()
{
getBMI();
System.out.println("A body mass index of 20-25 is considered \"normal\"");
double bmiMetric = weightKG/Math.pow(heightCM/100.0, 2);
System.out.print("Your BMI is " + bmiMetric);
}
However, I am getting an error when attempting to getBMI(); in the calculateMetricBMI.
EDIT:
Decided to add parameters to getBMI(); Now it shows getBMI(int weightKG, heightCM);
However I get this error:
'.class' expected
';' expected
';' expected
unexpected type required: value found: class