Question: Step 1: Write a Java application that asks the user to enter the weight (in kg) and height (in cm) of a person. Then, the
Step 1: Write a Java application that asks the user to enter the weight (in kg) and height (in cm) of a person. Then, the program will calculate the person's BMI according to this formula BMI = weight / (height?) * 10000 Then it will show the following on screen: - "Underweight" for BMI 18.5 "Normal" for 18.5 = 30 BMI 30 Step 2: Extend the program using a loop, so it repeats the process for any number of people, until a -1 is entered for weight or height. Step 3: Extend the program so that it counts and displays how many people are not obese, and the percentage of underweight people Example output: Enter weight, or -1 to terminate: 100 Enter height, or -1 to terminate: 180 BMI is 30.9 (Obese) Enter weight, or -1 to terminate: 80 Enter height, or -1 to terminate: 170 BMI is 27.7 (Overweight) Enter weight, or-1 to terminate: 50 Enter height, or-1 to terminate: 160 BMI is 19.5 (Normal) Enter weight, or -1 to terminate: 60 Enter height, or -1 to terminate: 150 BMI is 26.7 (0verweight) Enter weight, or 1 to terminate: -1 The number of non-obese people is 3 The percentage of underweight people is 0.0%
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
