Assignemnt #48 and BMICalculator
Code
/// name: Leila Ordukhani
/// period: 6
/// program name: Thirty-Seven Program
/// file name: BMICatagories.java
/// date finished: 11/3/15
import java.util.Scanner;
public class BMICatagories
{
public static void main(String[] args)
{
Scanner keyboard = new Scanner(System.in);
double m, kg, bmi;
System.out.print( "Your height in m: " );
m = keyboard.nextDouble();
System.out.print( "Your weight in kg: " );
kg = keyboard.nextDouble();
bmi = kg / (m*m);
System.out.println( "Your BMI is " + bmi );
if ( bmi < 18)
{
System.out.println("You are underweight.");
}
else if ( bmi < 22 )
{
System.out.println("Your weight is good.");
}
if ( bmi > 22 )
{
System.out.println("You are overweight.");
}
}
}
Picture of the output