BMICalculator
Code
import java.util.Scanner;
public class BMICalculator
{
public static void main( String[] args )
{
Scanner keyboard = new Scanner(System.in);
double feet, inches, kg, bmi;
System.out.print( "Your height (feet only): " );
feet = keyboard.nextDouble();
System.out.print( "Your height (inches only): " );
inches = keyboard.nextDouble();
System.out.print( "Your weight in kg: " );
kg = keyboard.nextDouble();
bmi = kg / ((feet*.3048+inches*.0254)*(feet*.3048+inches*.0254));
System.out.println( "Your BMI is " + bmi );
}
}
BMICalculator