210k views
5 votes
Writing a program to calculate a person's BMI is an example of using a math algorithm. In the BMI case,

you used a formula to find a person's BMI and assigned the result to a category. Your program handled
possible errors. This man needs to be concerned about his potential errors.

User LenW
by
7.1k points

1 Answer

5 votes

Answer:

BMI is calculated = mass or weight in kilograms / height in meters.

Examples:

Input : height(in meter): 1.79832

weight(in Kg): 70

Output : The BMI is 21.64532402096181, so Healthy.

Explanation : 70/(1.79832 ×1.79832)

Input : height(in meter): 1.58496

weight(in Kg): 85

Output : The BMI is 33.836256857260594 so Suffering from Obesity

Explanation : 70/(1.58496×1.58496).

User Dom DaFonte
by
7.2k points