Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Program language: python 3 Daily Energy Expenditure and Consumption Profile for an Exercise Enthusiast An exercise enthusiast wants to under stand (visualize) their daily caloric

Program language: python 3
image text in transcribed
image text in transcribed
image text in transcribed
Daily Energy Expenditure and Consumption Profile for an Exercise Enthusiast An exercise enthusiast wants to under stand (visualize) their daily caloric expenditure and consumptionper day given their weekly weight loss goal To determine their caloric expendture and consumption, they have to do three things as follows (a) They have to determine their Basal Metabolic Rate (BMR) using the Miffin-St Jeor equation shown be- low Their BMR is the est imated number of calories a person burns perday when theyare at rest. In other words, it is the number of calories a person should consume in a day to maintain their body-weight Male: BMR 10W+6.25H-5A +5 Female: BMR-0W +6.25H-5A-161 Where BMR Basal Metabolic Rate per day W-Weight of the enthusiast (in kg) H- Height of the enthusiast (in cm A Age of the enthusiast (b) They have to determine the net number of calories they should consumeper day (NCC) on the average to know how much weight in pound) they should be losing per week (WD) The following equation shows how to calculate their weight loss (in pound) per week if their NCC and BMR are known WL 7(BMR-NCC)/3500 Where L-Weight loss (in pound) per week BMR Basal Metabolic Rate per day NCC Net calorie consumed per day For example, to lose 1 pound per week, the enthusiast should consume a net calorie that is 500 less than their BMR per day. (Note: based on the formula, a negative WL means weight is gained) (c) Finally, toknow the number of calories they should burn per day to achieve their overall weekly weight loss goal, they have to specifically calculate calorie burned (CB) per day as follows Where -calorie burned per day cC Calorie consumed per day NCC Net calorie consumed per day Let's assume that the enthusiast consumes 3000 calories per day on the average over a week period and their weekly weight loss (WL) goal is 1 pound How many calories do they need to burn per day given that their weight (H) is 165 pounda, their height (H) is 5 feet and their age (A) is 25. Note: to convert pound to kg and feet to cm use the following equations H(m) H(feet) 30.48 Here's a guide for getting this program working You should try your program out every time you reach a point where you've accomplished one of the items in the list. Don't wat to the end to try it out This should be a very gradual process of getting something working, then moving on to the next part In solving this question, you will be expected to create three program fles: 'mainpy (which contains the main program from which required functions in some other modules will be callec), 'energypy (a module which contains functions for calculating BMR, NCC and CB) and 'conversionpy' (a module which contains two functions for converting weight in pound) to weight (in kg). and height (in feet)to height (in cm).Alright let's begin (a) Create a function called calculateBMR() in the module file named energypy: This function will cal- culate the BMR of the enthusiast and return the value. Document it with a docstring (b) Create a second function called convpound to kg O in the module ile named "conversionpy' This function will convert the weight of the enthusiast in pound to kg and return the value. Document it with a docstring (c) Create a third function called conv feet tocm) in the module file named conversion py. This func tion will convert the weight of the enthusiast in pound to kg and return the value. Document it with a (d) Create the main program 'mainpy. Document it with a docstring. In the main file, import the two modules into your program and request the user to enter the following inputs from the keyboard e Name Weight (in pound) Heightin feet) . Age Calories consumed (per day) . Gender (M or F . Weight loss (in pound) per week The inputs will be stored in the variables name, W, H, A,CC, G and VL, respectively energy py" module and passing in the weight to be converted as an argument versionpy module and passing in the height to be converted as an argument e) Convert the weight in pound) to weight in kg) by calling the conv pound.to.kg) function from the f) Convert the height (in feet) to weight (in cm) by calling the conv feet tocm) function from the 'con- (g) Calculate the BMR using one of the first two equations above. You will need an if statement to makea selection between male and female. Moreover, you will need to pass in W, H, A and Gas arguments (h) Calculate the NCC using the third equation above. (Hint: make NCCthe subject of the formula and create the function calculat eNCC ) in the pre-existing module file named energy py: Then call it in the main program Specifically. call the calculat eNCCO function by passing in the arguments WL and BMR and returning the NCC value ) Calculate the CB using the fourth equation by passing in the arguments CC and NCC (Hint create the function calculateCB) in the pre-existing module file named energypy' and call it in the main pro- gram) Print out all three energy (BMR. " cai values, with each well identified or labeled (see sample output below Here's a guide for getting this program working You should try your program out every time you reach a point where you've accomplished one of the items in the list. Don't wat to the end to try it out This should be a very gradual process of getting something working, then moving on to the next part Sample Input and Output Your console output should look something like this: Enter your name: Kim Enter your veight (in pound): 165 Enter your height (in feet): 5 Enter your age: 25 Enter your average calories consumed per day: 3000 Enter gender (M or F):M Enter the veight (in pound) you intend to lose per veek: 1 Daily Caloric Expenditure and Consumption Profile for Kim Kim 's Basal Metabolic Rate (BMR) is: 1575.0 Kim 'a Calorie Consumed (CC) per day is: 3000.0 Kim 's Calorie Burned (CB) per day is: 1925.0

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

Data Analysis Using SQL And Excel

Authors: Gordon S Linoff

2nd Edition

111902143X, 9781119021438

More Books

Students also viewed these Databases questions

Question

1. Where will you recommend that she hold the focus group?

Answered: 1 week ago

Question

3. What might you have done differently

Answered: 1 week ago