C++ 30The program should include the functions two functions getValues() and InvalidInput() besidemain(). Wherein getValues() is asked the user to enter the weight and the height of the body,...


C++


Write a program that calculates and displays a person's body mass index (BMI). The BMI is often<br>used to determine whether a person with sedentary lifestyle is based on the given categories<br>according to the following table.<br>A person's BMI is calculated with the following formula:<br>BMI = (weight (kg) / height2 (cm)) x 10,000<br>Category<br>BMI range - kg/m²<br>Severe Thinness<br>< 16<br>Mild Thinness<br>16 - 21<br>Normal<br>22<br>Overweight<br>23 - 30<br>Obese Class<br>>30<br>The program should include the functions two functions getValues() and InvalidInput() beside<br>main(). Wherein getValues() is asked the user to enter the weight and the height of the body, and<br>calculate the BMI inside it, then it will return the value of BMI to main function. InvalidInput() is<br>called in getValues() to develop an Input Validation to enforce the user to enter the inputs of the<br>weight and the height greater than 0. getValues() is then called from main() and accordingly<br>categorize the BMI based on the given table above. Additionally, calculate the needed BMI to<br>reach the normal BMI under each category, wherein normalBIM is a global variable that equals to<br>22. The formula is: reachNormalBMI = BMI - normalBMI<br>Sample of the Output<br>Enter the weight of your body? 16.9<br>Enter the height of your body? 105.4<br>You are in the category Severe Thinness<br>Your BMI is: 15<br>To reach normal category, you need to add 7 to your current BMI.<br>

Extracted text: Write a program that calculates and displays a person's body mass index (BMI). The BMI is often used to determine whether a person with sedentary lifestyle is based on the given categories according to the following table. A person's BMI is calculated with the following formula: BMI = (weight (kg) / height2 (cm)) x 10,000 Category BMI range - kg/m² Severe Thinness < 16="" mild="" thinness="" 16="" -="" 21="" normal="" 22="" overweight="" 23="" -="" 30="" obese="" class="">30 The program should include the functions two functions getValues() and InvalidInput() beside main(). Wherein getValues() is asked the user to enter the weight and the height of the body, and calculate the BMI inside it, then it will return the value of BMI to main function. InvalidInput() is called in getValues() to develop an Input Validation to enforce the user to enter the inputs of the weight and the height greater than 0. getValues() is then called from main() and accordingly categorize the BMI based on the given table above. Additionally, calculate the needed BMI to reach the normal BMI under each category, wherein normalBIM is a global variable that equals to 22. The formula is: reachNormalBMI = BMI - normalBMI Sample of the Output Enter the weight of your body? 16.9 Enter the height of your body? 105.4 You are in the category Severe Thinness Your BMI is: 15 To reach normal category, you need to add 7 to your current BMI.
Jun 04, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here