Assignment #26

Code

///Name: Mahima Choudhary
///Period: 6
///Project Name: BMICalculator
///File Name: BMICalculator
///Date Finished: 10/6/15
    
    import java.util.Scanner;

    public class BMICalculator
    {
    
        public static void main(String[] args)
        {
        
            Scanner keyboard = new Scanner(System.in);
            double m, kg, inches, pounds, bmi;
            
            System.out.print("Your height in inches: ");
            inches = keyboard.nextDouble();
            
            m = inches * 0.0254;
            
            System.out.print("Your weight in pounds: ");
            pounds = keyboard.nextDouble();
            
            kg = pounds * 0.453592;
            
            bmi = kg / (m*m);
            
            System.out.println("Your BMI is " + bmi);
        }
    }

Picture of the output

YourInitials.html