Assignment #48 and BMI Catigories
Code
/// Name: Graham Pollock
/// Period: 5
/// Program Name: BMI Catigories
/// File Name: BmiCatigories.java
/// Date Finished: 11/09/2015/
import java.util.Scanner;
public class BmiCatigories
{
public static void main( String[] args )
{
Scanner keyboard = new Scanner(System.in);
double inches, feet, pounds, bmi, tfi; //tfi = total feed plus inches
System.out.print( "Your height (feet only): " );
feet = keyboard.nextDouble();
System.out.print( "Your height (inches): " );
inches = keyboard.nextDouble();
System.out.print( "Your weight in Pounds: " );
pounds = keyboard.nextDouble();
tfi = ((feet*12) + inches) ;
bmi = (pounds / (tfi*tfi))*703;
//bmi = pounds/inches^2
//bmi = Math.round(((pounds / (tfi*tfi))*703)*1000)/1000;
// ^Trying to round to the #.##
System.out.println( );
if ( bmi < 15 )
{
System.out.println("BMI Catigory: Very Severely Underweight" );
}
if ( bmi >= 15 && bmi <= 16 )
{
System.out.println( "BMI Catigory: Severely Underweight" );
}
if ( bmi >= 16.1 && bmi <= 18.4 )
{
System.out.println( "BMI Catigory: Underweight" );
}
if ( bmi >= 18.5 && bmi <= 24.9 )
{
System.out.println( "BMI Catigory: Normal Weight" );
}
if ( bmi >= 25 && bmi <= 29.9 )
{
System.out.println( "BMI Catigory: Overweight " );
}
if ( bmi >= 30 && bmi <= 34.9 )
{
System.out.println( "BMI Catigory: Moderately Obese" );
}
if ( bmi >= 35 && bmi <= 39.9 )
{
System.out.println( "BMI Catigory: Severely Obese" );
}
if ( bmi >= 40 )
{
System.out.println( "You are very severely (or \"morbidly\") obese" );
}
System.out.println();
System.out.println( "Your BMI is " + bmi );
System.out.println();
}
}
Picture of the output