Lab9_Problem4 (1)
Lab9_Problem4 (1)
Lab 9 – Problem 4
Write a Python program to ask a user to input the user’s height and weight and compute the user’s
body mass index (BMI):
𝑤𝑒𝑖𝑔ℎ𝑡
𝐵𝑀𝐼 =
ℎ𝑒𝑖𝑔ℎ𝑡 2
where weight and height are in the units of kilogram and meter, respectively. Assume that the user
will always input positive numbers (i.e., no need to check the validation of the inputs). The
program will use the following three functions.
• Write a function called UserInput() to ask a user to input the user’s height and weight.
• Write a function called FindBMI(hh, ww) to compute the user’s BMI according to the
function’s inputs hh and ww, which are height and weight, respectively. The BMI is stored
in a variable UserBMI.
• Write a function called ShowBMI(MyBMI) to show the value of the user’s BMI which is
stored in the variable MyBMI.
The output should look similar to the following.