Assignment #26
Code
/// Name: Dr. Jonathan Stine
/// Period 5
/// Program Name: BMI
/// File Name: BMI.java
/// Date Finished: 10/10/15
import java.util.Scanner;
public class BMI
{
public static void main( String[] args )
{
Scanner keyboard = new Scanner(System.in);
double m, kg, bmi, inches, lbs;
System.out.println( "Your height in inches: " );
inches = keyboard.nextDouble();
System.out.println( "And your weight in pounds: " );
lbs = keyboard.nextDouble();
kg = lbs*0.453592;
m = inches*0.0254;
bmi = kg / (m*m);
System.out.println( "Your BMI is " + bmi );
}
}
Code Output