Write by python and screenshoot the python code for me . many thanks
The Problem:
You are to design a Calorie Intake Assistant tailored to the user’s 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:
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. It’s 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. It’s 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, let’s start! What is your gender? Enter M for male or F for female.
U: xxx
A: I’m 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: I’m sorry, I cannot understand. What is your age in years?
U: 0
A: I’m 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: Let’s 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: I’m 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 you’ve 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 you’ve been tempted with chocolate and 250 calories have been added!
A: 1241.5 calories intake in day 6. Also, it looks like this day you’ve 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. It’s recommended that you either lower your calorie intake, either exercise more!
A: Goodbye and good luck!
Below is a python program for the solution.Comments are given on every line explaining the code.Below is the output of the program: Output 1:
Output 2:
Below is the code to copy: #CODE STARTS HERE----------------
import random
name = input("Welcome to the Calorie Intake Assistant, my name is Cal. What is your name?\n") #input name
print("Great",name,", let’s start! What is your gender? Enter M for male or F for female.") #Ask for gender
while True: #loops until required information is given
try:
gender = input()
gender = str(gender).upper() #converts the character to uppercase
if gender == "M" or gender == "F": #matches the genders
break #breaks out of the loop if genders are given correctly
else:
raise Exception #prints error in except block and loops again
except:
print("I’m sorry, I cannot understand. What is your gender? Enter M for male or F for female.")
print("What is your age in years?")
while True:
try:
age = int(input())
if isinstance(age,int) and age>0: #Checks if age is a non 0 integer
break #breaks out of the loop if input is given correctly
else:
raise Exception #prints error in except block and loops again
except:
print("I’m sorry, I cannot understand. What is your age in years?")
print("What is your current weight in kg?")
while True:
try:
weight = float(input())
if isinstance(weight,float) and weight>0: #Checks if weight is a non 0 float
break #breaks out of the loop if input is given correctly
else:
raise Exception #prints error in except block and loops again
except:
print(" I’m sorry, I cannot understand. What is your weight in kg?")
print("What is your height in cm?")
while True:
try:
height = float(input())
if isinstance(height,float) and height>0: #Checks if height is a non 0 float
break #breaks out of the loop if input is given correctly
else:
raise Exception #prints error in except block and loops again
except:
print(" I’m sorry, I cannot understand. What is your height in cm?")
print("Thank you for the information ",name,"!\n")
rdci=0
if gender == "M": #calculating calories for male
rdci = (10*weight)+(6.25*height)-(5*age)+5
if gender == "F": #calculating calories for female
rdci = (10*weight)+(6.25*height)-(5*age)-161
print("Considering the details given, your daily recommended intake is of",rdci,"calories per day.\n")
print("Let’s see how healthy your meals were last week.\n")
meal_score=[]
for x in range(7): #taking input for everyday's healthy_meal score
while True:
print("Day ",x+1,": were your meals very unhealthy (1), unhealthy (2), healthy (3), or very healthy "
"(4)? Enter the corresponding number.")
try:
inp = int(input())
if 1<=inp<=4: #Checking the input values
meal_score.append(inp) #store the scores in a list
break #breaks out of the loop if input is given correctly
else:
raise Exception #prints error in except block and loops again
except:
print("I’m sorry, I cannot understand.", end="")
day=0 #Counter for days in a week
daily_cal=0 #To store daily calorie consumed
weekly_cal=0 #To store weekly calorie consumed
for x in meal_score:
day+=1
tempted_snack=""
tempt = random.choice([0,1]) #Tempted snack choosing randomly
snack = {"chocolate":"250","chips":"550","ice-cream":"207","fast-food":"350",
"fizzy drink":"180","party cake":"257","popcorn":"375"}
if tempt==1:
tempted_snack = random.choice(list(snack.keys())) #random snack
extra_calories = int(snack[tempted_snack]) #Calorie of the snack
else:
extra_calories=0
if x == 1: #Finding cal consumed
daily_cal=rdci*1.5+extra_calories
if x == 2:
daily_cal=rdci * 1.2+extra_calories
if x == 3:
daily_cal=rdci+extra_calories
if x == 4:
daily_cal=rdci*0.8+extra_calories
weekly_cal+=daily_cal
print(round(daily_cal,2)," calories intake in day", day,end="")
if tempt==1: #printing the random snack name and cal count
print(". Also, it looks like this day you’ve been tempted with",tempted_snack,"and",extra_calories,"calories have been added!")
else:
print("")
adci = weekly_cal/7 #calculating actual daily calorie intake
print("\nDuring the last 7 days you had an intake of",round(weekly_cal,2),"calories, meaning a daily average of",round(adci,2),"calories.")
ratio = (adci/rdci )*100 #Finding the ratio and printing the corresponding message
if ratio<90:
print(name,", your daily calorie intake is lower than the recommended with",round(abs(ratio-100),2),"%. "
"This way you will lose weight, just make sure your meals contain all nutritional value needed. It’s recommended "
"that you do not fall under the healthy weight and that you keep a balanced lifestyle.")
if 90<=ratio<=110:
print(name,", your daily calorie intake is close to the recommended one! You have a balanced healthy lifestyle, well done!")
if ratio>110:
print(name,", your daily calorie intake is higher than the recommended with",round(abs(ratio-100),2),"%. "
"This way you will gain weight, and in time health concerns may arise. It’s recommended that you either lower your calorie intake, "
"either exercise more!")
print("\nGoodbye and Goodluck!")
#CODE ENDS HERE-----------------
Write by python and screenshoot the python code for me . many thanks The Problem: You...
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 user’s 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...
I need help to write a program in Java. If a moderately active person cuts their calorie intake by 500 calories a day, they can typically lose about 4 pounds a month. Write a program that lets the user enter their starting weight, then creates and displays a table showing what their expected weight will be at the end of each month for the next 6 months if they stay on this diet.
please help! i csnt seem to create a two day diet plan that meet
the total calories from fat and saturated fat!
2-Day Healthy Eating Plan Template The My Plate food groups include: vegetables, fruits, dairy, protein, grains, and oils. Once you've - menu i undated with your final diet plan by listing each Checklist for Developing Your 2-Day Healthy Eating Plan Instructions: Use the criteria listed in the checklist to develop your 2-Day Healthy Eating Plan. Table: 2-Day Healthy...
APPLICATION EXERCISE Albert's Weight Status Albert is overweight by 25 pounds and is very serious about reducing his body weight from 200 pounds down to 175 and a healthier BMI of 22. He is currently sedentary, is con- suming an average 3,600 Calories per day, and is still gain- ing weight. You may assume that he needs 15 Calories per pound body weight to maintain his current weight. Using information presented in the text, develop a weighi-loss program for Albert....
What do people actually order at Chipotle? How healthy is a normal Chipatle meal? Chipotle and other relatively new fast casual chains ike Shake Shack, Potbelly and Five Guys typically promote themselves as having healthier menu choices than the traditional fast foad outlets like McDonald's, Taco Bell, Burger King, etc. The recommended daily calorie intake for most adults is 1,600 to 2,400. The histogram below shows the calories in approximately 3,000 meals ordered from Chipotle on Grubhub. Many burritos and...
I really need to learn how to do this macronutrient
calculation?
We were unable to transcribe this imageTotal calories from carbohydrate_ X100- (Divided by) Total daily caloric intake Per above, my average intake was: % percent of calories from carbohydrate The AMDR for carbohydrate as a percentage of total calories is 45 to 65 %. Was the percent of calories from carbobydrate in your 3-day average intake within the AMDR for carb? YesNo If NO: what suggestions would you make...
can you help me with this food chart with the recommended
minumum maximum and the second chart for one day. I am 20 year
female and to maintain my current weight I need to eat 2200
calories a day.
Energy Distribution Analysis 3 Day Total Grams Kcals perg 4 Protein Fat Carbs Alcohol 3 Day Kcals 0 0 0 0 4 7 Total Calories consumed in 3 Day period- 0 % Calories from PROTEIN % Calories from FAT % Calories...
Erin is a 28-year-old professional woman who is 5 feet 8 inches tall and maintains her weight at 118 pounds by following a lacto-ovo (non-fat milk and egg whites only) vegetarian diet that supplies approximately 1200 calories a day. With her understanding that protein should provide between 10 and 35 percent of her daily calories, she reasons that her daily intake of 40 grams of protein from milk, eggs, legumes, and nuts is adequate for her needs. She is concerned,...
Nutrition: please tell me what the correct answers are I believe
all the ones I chose were incorrect. 3 questions with it.
Help Save & Exlts Sub Required information Food Label Calculations: % Daily Values Read the overview and complete the activities that follow In the Nutrition Facts panel, there is a column labeled "% Daily Value," which is sometimes abbreviated as "% DV" Daily Values are recommended nutrient intakes for one day for an adult consuming a 2000 Calorie...
Please write a Java program that ask the user how many beers he or she expects to consume each day, on average, as well as the average amount of money he or she spends on a single 12-ounce can of beer. Studies have shown that, on average, someone who consumes a single 12-ounce can of beer every day without compensating for the calorie intake through diet modifications or extra exercise, will gain approximately 15 pounds in one year. You can...