wes d2a2ba9e15 first commit | 4 years ago | |
---|---|---|
.. | ||
README.md | 4 years ago | |
code.cpp | 4 years ago | |
unitTest.cpp | 4 years ago |
by Matt tags: strings, math
Body Mass Index (BMI) is found by taking your weight in kilograms and dividing by the square of your height in meters. The BMI categories are: Underweight: <18.5 Normal weight: 18.5–24.9 Overweight: 25–29.9 Obesity: BMI of 30 or greater Create a function that will accept weight and height (in kilos, pounds, meters, or inches) and return the BMI and the assoc
Body Mass Index (BMI) is found by taking your weight in kilograms and dividing by the square of your height in meters. The BMI categories are:
Create a function that will accept weight and height (in kilos, pounds, meters, or inches) and return the BMI and the associated category. Round the BMI to nearest tenth.
BMI("205 pounds", "73 inches") ➞ "27.0 Overweight"
BMI("55 kilos", "1.65 meters") ➞ "20.2 Normal weight"
BMI("154 pounds", "2 meters") ➞ "17.5 Underweight"