Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Focus On Geodatabases In ArcGIS Pro

Authors: David W. Allen

1st Edition

1589484452, 978-1589484450

More Books

Students also viewed these Databases questions

Question

Define analytics.

Answered: 1 week ago