Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in python format, please double check for errors with indentations etc. Task 4: BMI for the Final Time! We've also seen the BMI several times

image text in transcribed

image text in transcribed

in python format, please double check for errors with indentations etc.

Task 4: BMI for the Final Time! We've also seen the BMI several times and created a number of functions to calculate the BMI given some user input. However, we never really evaluated what the BMI means. In this task we'll change this. The body mass index (BMI) is given by the formula weightkg (heightm) where weight is weight (or, more precisely, mass) in kilograms and height We have the following functions from Lab #3: is height in meters. . convert.height * convertweight with parameter height that converts height to meters with parameter weight that converts weight to kilograms (i.e mass . calc.bmi) with parameters height.m and mass In this task, you'll write two more functions: * classify bmi: Given a BMI, this function will report back a classification to be printed by main) * main ): Prompts a user for his or her weight in pounds and height in inches, calls all other functions as needed, prints the final results. Also declare global variables kg-per lb0.45359237 and m-per.inch0.0254 at the beginning of the program, i.e., before defining functions and end with a call to main ( ) . Save all the files in a program called bmi.py to a folder called Lab5 under CSI11. The table below gives the BMI classifications: 18.5 or lessUnderweight 18.5 to 24.99 Normal Weight 25 to 29.99 Overweight 0 to 34.99 Obesity (I) 35 to 39.99Obesity (II) 40 or greater Morbid Obesity Enter height [inches]: 72 2 Enter weight [pounds] 160 4 BMI 21.6996783839 Mass72.5747792 [g 6 Height-1.8288 [m 7 BMI ClassificationNormal Weight Anotherexample (this time with float inputs): Enter height [inches]: 66.5 2 Enter weight [pounds]: 111.5 4 BMI 17.7267811 92778855 Mass50.575549255000006 [kg] 6 Height = 1.6890999999999998 [m] 7 BMI Classification-Underweight

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design For Mere Mortals

Authors: Michael J Hernandez

4th Edition

978-0136788041

More Books

Students also viewed these Databases questions