Assignemnt #26
Code
/// Name: Daniel Nguyen
/// Period: 6
/// Program Name: BMICalc Program
/// File Name: BMICalc.java
/// Date Finished: 9/9/2015
import java.util.Scanner;
public class BMICalc
{
public static void main( String[] args )
{
Scanner keyboard = new Scanner(System.in);
double m, kg, bmi, ft, in, lb;
System.out.print( "Your height in feet: " );
ft = keyboard.nextDouble();
System.out.print( "Your height in inches: " );
in = keyboard.nextDouble();
System.out.print( "Your weight in pounds: " );
lb = keyboard.nextDouble();
bmi = lb / (ft+in)*(ft+in);
System.out.println( "Your BMI is " + bmi );
}
}
Picture of the output