Assignemnt #26
Code
/// Name: Ryan Volko
/// Period: 7
/// Program Name: BMI Calculator Program
/// File Name: BMICalculator.java
/// Date Finished: 10/1/2015
import java.util.Scanner;
public class BMICalculator
{
public static void main( String[] args )
{
double m, kg, bmi, lbs, in;
Scanner keyboard = new Scanner(System.in);
System.out.print( "What is your hieght in m? ");
m = keyboard.nextDouble();
System.out.print( "What is your weight in kg? ");
kg = keyboard.nextDouble();
in = m * 39.3701;
lbs = kg * 2.20462;
System.out.println( "Which means you are " + in + " inches and " + lbs + " pounds.");
bmi = kg / (m*m);
System.out.println( "So your BMI is " + bmi );
}
}
Picture of the output