Assignemnt #26 Calculations with User Input
Code
/// Name: Jake Johnson
/// Period: 7
/// Program Name: BMICalc
/// File Name: BMICalc.java
/// Date Finished: 9/21/2015
import java.util.Scanner;
public class BMICalc
{
public static void main (String [] args)
{
Scanner keyboard = new Scanner(System.in);
double in, ft, lbs, bmi, inTall, inMetric, lbsMetric;
System.out.print("Your height (feet only): ");
ft = keyboard.nextDouble();
System.out.print("Your height (inches): ");
in = keyboard.nextDouble();
System.out.print("Your weight in pounds: ");
lbs = keyboard.nextDouble();
inTall = (ft * 12) + in;
inMetric = inTall * 0.025;
lbsMetric = lbs * 0.45;
bmi = lbsMetric / (inMetric * inMetric);
System.out.println("Your BMI is: " + bmi);
}
}
Picture of the output