Assignment 48, BMI Categories
Code
///Name: Stella Koliavas
///Period: 5
///Program Name: BMI Calc 2
///File Name: BMICalc2.java
///Date Finshed: 11/17/15
import java.util.Scanner;
public class BMICalc2
{
public static void main( String [] args)
{
Scanner siri = new Scanner(System.in);
Double in, lbs, kg, m, bmi ;
System.out.print("Your height in in: " );
in = siri.nextDouble();
System.out.print("Your weight in lbs: " );
lbs = siri.nextDouble();
bmi = (lbs * .4535)/ ((in * .0254)*(in* .0254));
System.out.println("Your BMI is " + bmi );
if (bmi < 15.0)
{
System.out.println("You're very severly underweight.");
}
if ( 15.0 <= bmi & bmi <= 16.0)
{
System.out.println("You're severly underweight.");
}
if ( 16.1 <= bmi & bmi <= 18.4)
{
System.out.println("You're underweight.");
}
if ( 18.5 <= bmi & bmi <= 24.9)
{
System.out.println("You're normal weight.");
}
if ( 25.0 <= bmi & bmi <= 29.9)
{
System.out.println("You're overweight.");
}
if (30.0 <= bmi & bmi <= 34.9)
{
System.out.println("You're moderately overweight");
}
if ( 35.0 <= bmi & bmi <= 39.9)
{
System.out.println("You're severly obese.");
}
if (bmi > 39.9)
{
System.out.println("You're morbidly obese.");
}
}
}
Picture of the output