Assignemnt #26
Code
/// Name: Holden Ganch
/// Period: 7
/// Program Name: Twenty sixth Program
/// File Name: BMICalculator.java
/// Date Finished: 10/1/2015
import java.util.Scanner;
public class BMICalculator
{
public static void main( String[] args )
{
Scanner keyboard = new Scanner(System.in);
double m, kg, bmi, feet, in, lbs, bmi1;
System.out.print( "Your height in m: " );
m = keyboard.nextDouble();
System.out.print( "Your weight in kg: " );
kg = keyboard.nextDouble();
bmi = kg / (m*m);
System.out.println( "Your BMI is " + bmi );
System.out.print( "Your height in feet: " );
feet = keyboard.nextDouble();
System.out.print( "Your height in inches: " );
in = keyboard.nextDouble();
System.out.print( "Your weight in pounds: " );
lbs = keyboard.nextDouble();
kg= lbs*.45391;
m = in*.0254;
bmi1 = kg / (m*m);
System.out.println( "Your BMI is " + bmi1 );
}
}
/// m = in * .0254
///kg= lbs*.45391
/// bmi = kg / (m*m)
Picture of the output