1. Engineering
  2. Computer Science
  3. in python code...

Question: in python code...

Question details

Task 3: Body Mass Index and Metric Dimensions The body mass index (BMI) is given by the formula weightkg (heightm)2 where weightkg ís weight (or, more precisely, mass) in kilograms and height,n İs height in meters Write a program that does the following: . Prompts a user for his or her weight in pounds and height in inches Declares global variables kg-per lb-0.45359237 and m.per.inch -0.0254 Calls a function convert.height with parameter height that converts height to me- ters Calls a function convert weight kilograms (i.e., mass) with parameter weight that converts weight to Calls a function calc.bmi) with parameters height.m and mass . Prints the results as given in the examples below Enter weight [pounds] 160 2Enter height [inches]: 72 BMI 21.6996783839 5 Mass = 72.5747792 [kilograms] 6 Height 1.8288 [meters] Another example (this time with float inputs):

i Enter weight [pounds]: 130.5 2 Enter height [inches]: 69.5 4BM1 = 18.9949961478 s Mass59.193804285 [kilograms] 6 Height = 1.7653 [meters]

in python code

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution