Assignemnt #26 and BMI Calculator
Code
///Name: Dakota Donahue
///Period: 5
///Project Name: BMI Calculator
///File Name: BMICalculator
///Date: 9/22/2015
import java.util.Scanner;
public class BMICalculator
{
public static void main( String[] args )
{
Scanner keyboard = new Scanner(System.in);
double ht, ft, in, lb, bmi;
System.out.print( "Your height (in feet only): " );
ft = keyboard.nextDouble();
System.out.print( "Your height (in inches only): " );
in = keyboard.nextDouble();
System.out.print( "Your weight in pounds: " );
lb = keyboard.nextDouble();
ht = ft + (in/12);
bmi = lb / (ht*ht);
System.out.println( "Your BMI is " + bmi );
}
}
Picture of the output