Question
To maintain ones body weight, an adult human needs to consume enough calories to (1) meet the basal metabolic rate ( energy required to breathe,
To maintain ones body weight, an adult human needs to consume enough calories to (1) meet the basal metabolic rate ( energy required to breathe, maintain body temp,), (2) account for physical activity such as exercise, and (3) account for the energy required to digest the food that is being eaten.
If an adults weights P pounds:
1) Basal Metabolic rate: calories required = 70 * (P/2.2)0.756
2) Physical activity (approx.): calories required = 0.0385 * 5 * P * minutes
Where minutes is the amount of time spent exercising that day.
3) Energy to digest food: calories = calories eaten * 0.1
Write a function to calculate the basal metabolic rate, taking as input the weight & returning the calories.
Write another function to calculate the physical activities calories, taking as input the weight & minutes spent and returning the calories.
Write another function to calculate the digestion calories, taking as input the calories eaten & returning the calories.
Now write the main program, that prompts the user for the inputs, calls the three function to calculate the total calories needed for the day (sum of the three returned values). The program then tells him/her if they ate too many or too little calories for the day.
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