Question
continue the MPG calculator, but more. In this assignment you will practice the following in Python: o Defining and using functions o Using loop to
continue the MPG calculator, but more. In this assignment you will practice the following in Python: o Defining and using functions o Using loop to go through a list, do necessary processing o Handling errors o Finding out average and highest values
The background The background information is the same as in Assignment One (below). We will continue working on the BMI tracker. A persons BMI is calculated with the following formula: BMI=Weight*703/Height2 In the formula, weight is measured in pounds and height is measured in inches. BMI Level >=26 OW (overweight) >=19 OK
The Program 1. Rewrite the program to create a function that calculates BMI. The function takes in two parameters (weight and height) and returns BMI. 2. Create a second function that determine the level based on BMI. The function takes in one parameter (BMI) and returns corresponding level. 3. If the user enters incorrect input (non-numeric-looking input), your program should stop and provide an explanation. You can decide whether integer or float data type is appropriate. 4. We have a list of people. They are Max, Jack, and Joey. If you like you can make up your own list. Testing data are provided. We would like to go through the list, for each person, we enter information, calculate BMI, and display the level based on their BMI.
When outputting the BMI, you can choose to format it with 2 decimal points. Max Jack Mary weight 89 105 120 height 45 64 62 BMI About 30.9 About 18 About 22 Level OW UW OK
Python 3.8.10 (tags/v3.8.10:3d6993a, May 3 2021, 11:48:03) [MSC v.1928 64 bit (AVD64)] Type "copyright", "credits" or "license" for more information. IPython 8.8.0-- An enhanced Interactive Python. In [1]
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started