Question: python please Objectives The objectives of this lab are: - to show how functions can make programs easier to wnte and understand - to gain

python please
python please Objectives The objectives of this lab are: - to show
how functions can make programs easier to wnte and understand - to

Objectives The objectives of this lab are: - to show how functions can make programs easier to wnte and understand - to gain understanding of hew to use functions someone else has written - to gain understanding of function arguments - to gain understanding of function return values Description You will create a program to compute the Basic Metabolic Rate of aperson, which is the amount of caleries your body needs each day to - sustain its basic vital functions. This is similar to your project, but this time, we have provided a function that will calculate the EMR based on a persoris age, sex, height, and weight So all your program needs to do is prompt the user for their age, sex, weight in pounds, and height in inches, . Sunction will return the BMR, so you can then print out the message of the Your program will prompt the user for weight in pounds, height in inches, age in years, sex as ' m ' or , in that order. You may use whatever prompts you want and feel are appropriate. Then, once you have all of the information, you need to call the function called computeamR The arguments that need to be sent to the function are the age, sex, height, and weight, in that order. You can assume that all of the numeric inputs are integers, that is, no fractionat or decimol parts. The function ComputeBMR is included as an external file to the zytab, but you do not need to be able to see it or its code in order to use the function. You can treat the function as a black box that you send the proper argurnents to, and it will return the proper value to you, You need to tell Python that you are using a function from an external file, similar to how you need to tell it when you are using a function from the math or random libraries. You will need to include the following line at the beginning of your program: Theed to tell Pythen that you are ising a function from an external file similar to how you need to teil it when yous vere using a function from the math or random libraries. Yousill need to include the following line at the beginning of your program from EMAPunction import ComputeAMA This is telling Python that you are going to be using the function ComputeBMR which can be found in the Python file BMrP anction. When you import a function this way you do not need to do anything special to ind cate where it came from,just call the function as if it exists as part of Python. For example, computeBMR (25, ' f ', 62, 130) would call the function with age 25, female, height of 62 inches, and weight of 130 pounds: Onoe you receive the value back from the function, you need to printout a mesenge similar to the foliawing (depending on the inputs) Ac 68 inched ta11 and wetghing 155 pounds, at your age you need 1542.92 calorkes per day. Qt. At 63 inches tal 1 and weighing 140 pounds, at your age you need 1384.48 calories per day. BMR should be printed to 2 decininl places, even though the functionmwy be returning a float value withmore or less than 2 decimal places: NOTE You do not need to handie any error checking. That is done within the function. One of the test cxises illustrates this but you do not heed to do anything in your cote to handle errors

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!