Skip to content

Instantly share code, notes, and snippets.

Created January 19, 2017 00:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/924e1b344113cba2f9f4e81e9a148762 to your computer and use it in GitHub Desktop.
Save anonymous/924e1b344113cba2f9f4e81e9a148762 to your computer and use it in GitHub Desktop.
BMI Calc.
import java.util.Scanner;
public class bmi
{
public static void main(String[] args)
{
Scanner keyboard = new Scanner(System.in);
double feet;
double inches;
double weight;
double meters;
double kg;
System.out.print("Your height in feet: ");
feet = keyboard.nextDouble();
System.out.print("Your height in inches: ");
inches = keyboard.nextDouble();
System.out.print("Your weight in pounds: ");
weight = keyboard.nextDouble();
System.out.println(" ");
System.out.println("Your BMI is " + ((weight * .45) / ((((feet * 12) + inches) * .022) * 2)));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment