Body mass index (BMI) is a measure of body fat based on height and weight that applies to adult men and women.

The formula for calculating BMI is:

BMI = (weightInPounds * 703) / (heightInInches * heightInInches)

Create a BMI calculator application that reads the users weight in pounds and height in inches, then calculates and displays on screen the users body mass index and his/her status (Underweight, Normal, Overweight or Obese).

If the users status is not Normal, calculate and display how many pounds needed to lose or gain so that the user will have Normal status. You have to figure yourself the formula for the adjusted weight, which should be derived from the above formula for BMI.

Also, the application must display the following information from the Department of Health and Human Services/National Institutes of Health so the user can evaluate his/her BMI:

BMI VALUES
Underweight: less than 18.5
Normal: in the interval [18.5, 25.0]
Overweight: in the interval (25.0, 30.0]
Obese: greater than 30

Finally, your name as the programmer who wrote the program must be displayed on screen as well at the end.

Note:

  • Comments at the top of your source file must include a brief description of the program, your name and the date of finishing.
  • For decimal value, set limit to 2 digits after the dot (i.e. 12.45, N0T 12.4 OR 12.4999).
  • 1 point is deducted for each requirement that was not satisfied.

Input / Output Table of Data for Testing (Your program must pass the table)

Weight Height BMI Adjusted Weight Status
110 65 18.30 + 1.18 Underweight
111.20 65 18.50 Normal
152 65 25.29 - 1.75 Overweight
150.25 65 25.00 Normal
180.30 65 30.00 - 30.05 Overweight
180.40 65 30.02 - 30.15 Obese
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.