168k views
0 votes
MI Calculator, English Version, Professional, 30 Points - We Are Improving Our Standard (Std) BMI Calculator To Create A Professional (Pro) Version Of It. Write An Interactive Java Program That Performs These Actions: A. Prompt The User To Enter The User’s Name. B. Prompt The User To Enter Height In Feet And Inches (Both Integers) C. Read The Height D.

1 Answer

1 vote

Final answer:

An interactive Java program for calculating BMI would prompt the user for their name and height and apply the BMI formula using weight and height inputs. The program would calculate height in inches from feet and inches entries, then categorize BMI to assess body composition.

Step-by-step explanation:

Interactive Java Program for Calculating BMI

To create a professional version of a BMI calculator in Java, you would start by prompting the user for their name and then asking for their height in feet and inches. The program would then calculate BMI by converting feet and inches to inches, applying the formula from LibreTexts, and then categorizing the result based on standard BMI categories. It's important to note calculating BMI requires a height and weight input, however, as the question only specifies height, our example will focus on collecting and converting these measurements.

Here is a step-by-step breakdown of the program flow:

  • Prompt the user for their name.
  • Prompt the user to enter their height in feet and inches.
  • Read and convert the height into total inches (feet * 12 + inches).

From this point forward, if you had the user's weight, you would apply the BMI formula as follows:

BMI = [weight (lb) × 703] ÷ height(in)²

The calculated BMI can then be mapped to the weight category that indicates if the individual is underweight, normal, overweight, or obese based on standard BMI categories. These categories help to estimate the fat content of the body, an important factor of body composition related to health risks.

User Fixer
by
8.6k points