0% found this document useful (0 votes)
3 views

Lab9_Problem4 (1)

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Lab9_Problem4 (1)

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

ITS100 Introduction to Computers and Programming

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.

You might also like