Assignemnt #26

Code

///Colin Hinton
///5th Period
/// Bmi Calc
/// BmiCalc.java
/// 9/23/15

import java.util.Scanner;

class BmiCalc
{
    public static void main (String [] args )
    {
    
        Scanner keyboard = new Scanner(System.in);
        double weight, bmi, meters, metersNew, kg, kgNew;
        int inches, feet;
        
        meters = .0254;
        kg = .454;   
        System.out.print(" Your height (Feet only) ");
        feet = keyboard.nextInt();
        
        System.out.print(" Your height (Inches) ");
        inches = keyboard.nextInt();
        
        metersNew = ((( feet * 12) + inches) * meters);
        
        System.out.print(" Your Weight (in lbs) ");
        weight = keyboard.nextDouble();
        
        kgNew = weight * kg;
        bmi = kgNew / (metersNew * metersNew);
        
        System.out.print( " Your BMI is " + bmi );
        
    }
}

    

Picture of the output

Assignment 1