Body Mass Index Calculator App) The formulas for calculating the BMI are BMI =(w
ID: 3817538 • Letter: B
Question
Body Mass Index Calculator App) The formulas for calculating the BMI are
BMI =(weightInPounds × 703) /(heightInInches × heightInInches) or
BMI=( weightInKilograms)/(heightInMeters × heightInMeters)
Create a BMI calculator app that allows users to enter their weight and height and whether they are entering these values in English or metric units, then calculates and displays the user’s body mass index. The app should also display the following information from the Department of Health and Human Services/National Institutes of Health so that users can evaluate their BMIs:
BMI VALUES
Underweight: less than 18.5
Normal: between 18.5 and 24.9
Overweight: between 25 and 29.9
Obese: 30 or greater
[NOTE: must implement javaFX using netbean with BMI.java, BMIController.java and BMI.xml. i tried one solution before too but gave too many errors. is it possible to post the output too?]
Explanation / Answer
import java.util.Scanner;
public class BMI{
public static void main (String [] args) {
Scanner input = new Scanner (System.in);
int weight;
int height;
int bMI;
System.out.print ("Enter Your Weight in Pounds: ");
weight = input.nextInt();
System.out.print ("Enter Your Height in Inches: ");
height = input.nextInt();
bMI = (weight * 703) / (height * height);
System.out.printf ("Your Body Mass Index (BMI) is %d ", bMI);
System.out.println ("BMI VALUES");
System.out.println ("Underweight: less than 18.5");
System.out.println ("Normal: between 18.5 and 24.9");
System.out.println ("Overweight: between 25 and 29.9");
System.out.println ("Obese: 30 or greater");
}
}
import java.util.Scanner;
public class BMI{
public static void main (String [] args) {
Scanner input = new Scanner (System.in);
int weight;
int height;
int bMI;
System.out.print ("Enter Your Weight in Pounds: ");
weight = input.nextInt();
System.out.print ("Enter Your Height in Inches: ");
height = input.nextInt();
bMI = (weight * 703) / (height * height);
System.out.printf ("Your Body Mass Index (BMI) is %d ", bMI);
System.out.println ("BMI VALUES");
System.out.println ("Underweight: less than 18.5");
System.out.println ("Normal: between 18.5 and 24.9");
System.out.println ("Overweight: between 25 and 29.9");
System.out.println ("Obese: 30 or greater");
}
}