Question: Will someone help me with this Visual Studio assignment. It must be in C language (printf / scanf.... not < >). Write a program to

Will someone help me with this Visual Studio assignment. It must be in C language (printf / scanf.... not <>).

Write a program to calculate a Body Mass Index (BMI). The formula for BMI is:

BMI = weight * 703 / height2

where weight is in pounds and height is in inches. Enter both numbers into integer variables.

Hint: In the formula, you may need to convert one of the numbers entered into a double, and you will need to #include the library if you use the pow() function.

After the program displays the BMI (formatted to 1 decimal place), display a message that says the user is underweight, overweight, or at the optimal weight. A person is at the optimal weight if their BMI is between 18.5 and 25, a BMI below 18.5 is underweight, and a BMI over 25 is overweight.

In addition, if the user enters a value for weight that is not between the values of 1 and 1000, inform the user and exit the program. If the user enters a value for height that is not between the values of 1 and 108, inform the user and exit the program. Create constants for all the minimum and maximum values used in the validations, for the values used for under and over weight, and for the 703 multiplier used in the formula.

Example Run #1: (bold type is what is entered by the user)

Enter your height (in inches): 72 Enter your weight (in pounds): 180

Your Body Mass Index (BMI) is xx.x. You are at your optimal weight.

Example Run #2:

Enter your height (in inches): 70 Enter your weight (in pounds): 200

Your Body Mass Index (BMI) is xx.x. You are overweight.

Example Run #3:

Enter your height (in inches): -50 Height must be between 1 and 108.

The example runs show EXACTLY how your program input and output will look.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!