GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Java-Practice/BMI.java at master · fine-code/Java-Practice Expand file tree/ Copy pathBMI.javaMore file actions 37 lines (27 loc) · 909 Bytes / Copy pathBMI.javaFile metadata and controls37 lines (27 loc) · 909 Bytes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 public class BMI extends GaddisChallenges { private double userWeight; //pounds private double userHeight; //inches private double userBmi; private String weightStatus; public void start() { collectInfo(); userBmi = userWeight * 703/(userHeight * userHeight); if (userBmi >= 18.5 && userBmi < 25) { weightStatus = "optimal"; } else if (userBmi < 18.5) { weightStatus = "underweight"; } else if (userBmi > 25) { weightStatus = "overweight"; } print("Based on your height and weight, your BMI is " + userBmi + " so your weight is " + weightStatus); } private void collectInfo() { print("What is your height? "); userHeight = scan.nextDouble(); print("What is your weight? "); userWeight = scan.nextDouble(); } } |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |