Created
January 19, 2017 00:40
-
-
Save anonymous/924e1b344113cba2f9f4e81e9a148762 to your computer and use it in GitHub Desktop.
BMI Calc.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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