Assignemnt #26 and BMI Calculator
Code
///Name: Ben Borglin
///Period: 6
///Program Name: BMI Caluclator
///File Name: BMICalculator.java
///Date Finished: 9/21/15
import java.util.Scanner;
public class BMICalculator
{
public static void main( String[] args )
{
Scanner keyboard = new Scanner(System.in);
double f, lb, bmi, kg, m, in;
System.out.print( "Your height (Feet Only): " );
f = keyboard.nextDouble();
System.out.print( "Your height (Inches Only): " );
in = keyboard.nextDouble();
System.out.print( "Your weight in pounds: " );
lb = keyboard.nextDouble();
m = ((f*12)+in)*0.0254;
kg = lb*.453592;
bmi = kg / (m*m);
System.out.println( "Your BMI is " + bmi );
}
}
Picture of the output