Question
write by python code and screenshoot the python code for me. thanks The Problem: You are to design a Calorie Intake Assistant tailored to the
write by python code and screenshoot the python code for me. thanks
The Problem:
You are to design a Calorie Intake Assistant tailored to the users personal characteristics.
The assistant will initially ask the user for his/her gender, name, age in years, height in cm and weight in kg. Based on these, the assistant will calculate the recommended daily calorie intake (RDCI) using the Mifflin St Jeor formula[1], which is also shown to the user:
Mifflin St Jeor formula:
Men 10 x weight (kg) + 6.25 x height (cm) 5 x age (y) + 5
Women 10 x weight (kg) + 6.25 x height (cm) 5 x age (y) 161.
For each day of the week, the user must say how healthy their meals were: (very unhealthy, unhealthy, healthy, very healthy). Each meal has a corresponding calorie intake calculated based on the RDCI; the daily calorie intake is shown to the user.
| Meal type | Calorie count |
1 | Very unhealthy | 150% of RDCI |
2 | Unhealthy | 120% of RDCI |
3 | Healthy | RDCI |
4 | Very healthy | 80% of RDCI |
In addition, daily the user can be tempted to eat things that were not planned for, such as having an ice-cream on a hot day. The daily temptation is generated randomly as 1 or 0. If the temptation exists (1 has been generated), a food item is added, chosen randomly from the following list (in brackets is shown the calorie equivalent of the item):
Temptation | Calorie count |
chocolate | 250 |
chips | 550 |
ice-cream | 207 |
fast-food | 350 |
fizzy drink | 180 |
party cake | 257 |
popcorn | 375 |
For each day of the week the assistant calculates the daily calorie intake based on user ranking. Cal sums everything up and makes a daily average calorie intake (or ADCI), shown to the user. Based on this, Cal gives feedback and recommendations using the guide below. The program then exists.
ADCI / RDCI | Recommendations: |
Lower than 90% | Username, your daily calorie intake is lower than the recommended with x%. This way you will lose weight, just make sure your meals contain all nutritional value needed. Its recommended that you do not fall under the healthy weight and that you keep a balanced lifestyle. |
Between 90% and 110% | Username, your daily calorie intake is close to the recommended one! You have a balanced healthy lifestyle, well done! |
Higher than 110% | Username, your daily calorie intake is higher than the recommended with x%. This way you will gain weight, and in time health concerns may arise. Its recommended that you either lower your calorie intake, either exercise more! |
Example of How the Assistant Runs:
A: Welcome to the Calorie Intake Assistant, my name is Cal. What is your name?
U: Jane
A: Great Jane, lets start! What is your gender? Enter M for male or F for female.
U: xxx
A: Im sorry, I cannot understand. What is your gender? Enter M for male or F for female.
U: f
A: What is your age in years?
U: abd
A: Im sorry, I cannot understand. What is your age in years?
U: 0
A: Im sorry, I cannot understand. What is your age in years?
U: 25
A: What is your current weight in kg?
U: 59
A: What is your height in cm?
U: 150
A: Thank you for the information Jane!
A: Considering the details given, your daily recommended intake is of 1241.5 calories per day.
A: Lets see how healthy your meals were last week.
A: Day 1: were your meals very unhealthy (1), unhealthy (2), healthy (3), or very healthy (4)? Enter the corresponding number.
U: 2
A: Day 2: were your meals very unhealthy (1), unhealthy (2), healthy (3), or very healthy (4)? Enter the corresponding number.
U: 5
A: Im sorry, I cannot understand. Day 2: were your meals very unhealthy (1), unhealthy (2), healthy (3), or very healthy (4)? Enter the corresponding number.
U: 1
A: Day 3: were your meals very unhealthy (1), unhealthy (2), healthy (3), or very healthy (4)? Enter the corresponding number.
U: 2
A: Day 4: were your meals very unhealthy (1), unhealthy (2), healthy (3), or very healthy (4)? Enter the corresponding number.
U: 3
A: Day 5: were your meals very unhealthy (1), unhealthy (2), healthy (3), or very healthy (4)? Enter the corresponding number.
U: 3
A: Day 6: were your meals very unhealthy (1), unhealthy (2), healthy (3), or very healthy (4)? Enter the corresponding number.
U: 3
A: Day 7: were your meals very unhealthy (1), unhealthy (2), healthy (3), or very healthy (4)? Enter the corresponding number.
U: 4
A: Jane, here are your results:
A: 1489.8 calories intake in day 1
A: 1862.2 calories intake in day 2. Also, it looks like this day youve been tempted with popcorn and 375 calories have been added!
A: 1489.8 calories intake in day 3
A: 1241.5 calories intake in day 4
A: 1241.5 calories intake in day 5. Also, it looks like this day youve been tempted with chocolate and 250 calories have been added!
A: 1241.5 calories intake in day 6. Also, it looks like this day youve been tempted with party cake and 257 calories have been added!
A: 993.2 calories intake in day 7
A: During the last 7 days you had an intake of 10441.5 calories, meaning a daily average of 1491.64 calories.
A: Jane, your daily calorie intake is higher than the recommended with 20%. This way you will gain weight, and in time health concerns may arise. Its recommended that you either lower your calorie intake, either exercise more!
A: Goodbye and good luck!
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