Assignment #26 and BMI Calculator
Code
/// Name: Graham Pollock
/// Period: 5
/// Program Name: BMI Calculator
/// File Name: BmiCalculator.java
/// Date Finished: 10/7/2015
import java.util.Scanner;
public class BmiCalculator
{
public static void main( String[] args )
{
Scanner keyboard = new Scanner(System.in);
double inches, feet, pounds, bmi, tfi;
System.out.print( "Your height (feet only): " );
feet = keyboard.nextDouble();
System.out.print( "Your height (inches): " );
inches = keyboard.nextDouble();
System.out.print( "Your weight in Pounds: " );
pounds = keyboard.nextDouble();
tfi = ((feet*12) + inches) ;
bmi = (pounds / (tfi*tfi))*703;
//bmi = Math.round(((pounds / (tfi*tfi))*703)*1000)/1000;
// ^Trying to round to the #.##
System.out.println( );
System.out.println( "Your BMI is " + bmi );
}
}
Picture of the output