Assignment 48
Code
/// Name: Josh Bautista
/// Period: 6
/// Program Name: BMIC
/// File Name: BMIC.java
/// Date Finished: 12/10/2015
import java.util.Scanner;
public class BMIC
{
public static void main( String[] args )
{
Scanner keyboard = new Scanner (System.in);
int weight;
double height, BMI;
System.out.print(" Your height in inches ");
height = keyboard.nextDouble();
System.out.print(" Your weight in pounds ");
weight = keyboard.nextInt();
BMI = ( weight / height );
System.out.println(" Your BMI is " + BMI );
if ( BMI < 18.5 )
{
System.out.print(" BMI Category: underweight " );
}
if ( BMI >= 18.5 && BMI <= 24.9 )
{
System.out.print(" BMI Category: normal ");
}
if ( BMI >= 25.0 && BMI <= 29.9 )
{
System.out.print(" BMI Category: Overweight " );
}
if ( BMI >= 30.0 )
{
System.out.print(" BMI Category: Obese ");
}
}
}
Picture of Output