1. Engineering
  2. Computer Science
  3. an exercise enthusiast wants to understand visualize their daily caloric...

Question: an exercise enthusiast wants to understand visualize their daily caloric...

Question details

An exercise enthusiast wants to understand (visualize) their daily caloric expenditure and consumption per day given their weekly weight loss goal To determine their caloric expenditure 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 estimated number of calories a person burns per day when they are 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- 10W +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 consume per day (NCC) on the average to know how much weight (in pound) they should be losing per week (WL). 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: WL -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 to know 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 CB = CC-NCC Where: CB Calorie burned per day cc Calorie consumed per day NCC Net calorie consumed per day Lets assume that the enthusiast consumes 300O 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 (W) is 165 pounds, 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 W(kg)-W(pound)0.45H(cm) H(feet)30.48 Heres a guide for getting this program working. You should try your program out every time you reach a point where youve accomplished one of the items in the list. Dont wait 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 files: mainpy (which contains the main program from which required functions in some other modules will be called), energy.py (a module which contains functions for calculating BMR, NCC and CB) and conversion.py (a module which contains two functions for converting weight (in pound) to weight (in kg), and height (in feet) to height (in cm)). Alright, lets begin! (a) Create a function called calculat eBMRC) in the module file named energy.ру. 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 conv-pound_to_kg) in the module file named conversion.py: 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_to_cm) in the module file named conversion.py. This func- tion will convert the height of the enthusiast in feet to cm and return the value. Document it with a docstring (d) Create the main program main.py. 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: Name Weight (in pound) . Height(in feet) Calories consumed (per day) e 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 WL, respectively energy.py module and passing in the weight to be converted as an argument version.py 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 height (in cm) by calling the conv_feet_to_cm) function from the con- (g) Calculate the BMR using one of the first two equations above. You will need an if statement to make a selection between male and female. Moreover, you will need to pass in W, H, A and G as arguments. (h) Calculate the NCc using the third equation above. (Hint make NCC the subject of the formula and create the function calculateNCC) in the pre-existing module file named energy.py. Then call it in the main program. Specifically, call the calculateNCC) function by passing in the arguments WL and BMR and returning the NCC value (i) 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, CC, CB) values, with each well identified or labeled (see sample output below) Heres a guide for getting this program working. You should try your program out every time you reach aYour console output should look something like this: Enter your name: Kim Enter your weight (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 weight (in pound) you intend to lose per week1 Daily Caloric Expenditure and Consumption Profile for Kim Kims Basal Metabolic Rate (BMR) is 1575.0 Kims Calorie Consumed (CC) per day is: 3000.0 Kims Calorie Burned (CB) per day is: 1925.0

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