Question

write by python code and screenshoot the python code for me. thanks The Problem: You are...

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 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. 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!

0 0
Add a comment Improve this question Transcribed image text
Answer #1

type your code according to image:
sample output:

python code

user_name=input('Welcome to the Calorie Intake Assistant, my name is Cal. What is your name?')
Gender=input('Great Jane, let’s start! What is your gender? Enter M for male or F for female.')
while Gender not in ['F','M','f','m']:
Gender=input('I’m sorry, I cannot understand. What is your gender? Enter M for male or F for female.')
while True:
try:
Age=int(input('What is your age in years?'))
except ValueError:
print('I’m sorry, I cannot understand. What is your age in years?')
continue
else:
if Age<=0:
print('I’m sorry, I cannot understand. What is your age in years?')
continue
break
while True:
try:
Weight=int(input('What is your Current weight in Kg?'))
except ValueError:
print('I’m sorry, I cannot understand. What is your weight in Kg?')
continue
else:
break
while True:
try:
Height=int(input('What is your Height in cm?'))
except ValueError:
print('I’m sorry, I cannot understand. What is your height in cm?')
continue
else:
break
if 'm'==Gender.lower():
daily_recommended_intake=10*Weight+6.25*Height-5*Age+5
else:
daily_recommended_intake=10*Weight+6.25*Height-5*Age-161
print('Thank you for the information Jane!')
print('Considering the details given, your daily recommended intake is of {} calories per day.'.format(daily_recommended_intake))
print('Let’s see how healthy your meals were last week.')
mealtype={'1':1.5,'2':1.2,'3':1,'4':.8}
calory_intake_week=[]
count=1
import random
temptation_food={'chocolate':250,'chips':550,'ice-cream':207,'fast-food':350 ,'fizzy drink':180,'party cake':257,'popcorn':375}
temptation_food_calories=list(temptation_food.keys())
temptation=[]
for j in range(7):
temptation.append(random.randint(0, 1))
temptedfood=[]
count=1
while count<8:
while True:
print('Day {}: were your meals very unhealthy (1) unhealthy (2) healthy (3) very healthy (4) '.format(count))
x=input('Enter the corresponding number.: ')
if x in ['1','2','3','4']:
break
else:
print('I\'m sorry, I cannot understand.')
continue
temp=random.choice(list(temptation_food.keys()))
temptedfood.append(temp)
daily_intake=daily_recommended_intake*mealtype[x]+temptation[count-1]*temptation_food[temp]
calory_intake_week.append(daily_intake)
count+=1
print('Jane, here are your results:')
for i in range(len(calory_intake_week)):
print('{} calories intake in day {}, '.format(calory_intake_week[i],i+1),end='')
if temptation[i]==1:
print('Also, it looks like this day you’ve been tempted with {} and calories have been added!'.format(temptedfood[i]))
print()
print('During the last 7 days you had an intake of {} calories, meaning a daily average of {:.2f} calories.'.format(sum(calory_intake_week),sum(calory_intake_week)/len(calory_intake_week)))
average=sum(calory_intake_week)/len(calory_intake_week)
percentage=(average*100)/daily_recommended_intake
if percentage>110:
print('Jane, your daily calorie intake is higher than the recommended with {:.2f}%. 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!'.format(percentage-100))
if percentage<=110 and percentage>=90:
print('Username, your daily calorie intake is close to the recommended one! You have a balanced healthy lifestyle, well done!')
if percentage<90:
print('Username, your daily calorie intake is lower than the recommended with {:.2f}%. 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.'.format(100-percentage))
print('Goodbye and good luck!')

Add a comment
Know the answer?
Add Answer to:
write by python code and screenshoot the python code for me. thanks The Problem: You are...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • please help! i csnt seem to create a two day diet plan that meet the total...

    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...

    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....

  • I really need to learn how to do this macronutrient calculation? We were unable to transcribe...

    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...

  • IN PYTHON ONLY!!! Program 2: Design (Pseudocode) and implement (Source Code) a program that asks the...

    IN PYTHON ONLY!!! Program 2: Design (Pseudocode) and implement (Source Code) a program that asks the user for their height (in inches), weight (in pounds), age and gender. Use loops to validate user input and to continue running for a new user until a sentinel value is entered. Ask them to select their approximate level of exercise each week from the options below, then determine and print their allowed daily caloric intake using their BMR: Female BMR = 655+(4.35 *...

  • can you help me with this food chart with the recommended minumum maximum and the second...

    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...

  • Write a basic C++ program that will calculate a subject’s basal metabolic rate and estimate how...

    Write a basic C++ program that will calculate a subject’s basal metabolic rate and estimate how many days it will take to lose a specific number of pounds. The program will perform the following tasks: Declare variables and Named constants. Display “Welcome to <your name>’s Weight Loss Calculator” Prompt the user to enter the subject’s current weight. Prompt the user to enter the subject’s height in feet plus inches. Prompt the user to enter the subject’s age. Prompt the user...

  • the first and 4th page is the answer page( the qurstions that has to be answered....

    the first and 4th page is the answer page( the qurstions that has to be answered. ) my height is 5’9” i weigh 150 pounds. if you can kindly use this information and do this assignment for me that will be helpful Introductory to Nutrition Assignment - Due Monday, October 21, 2019 Assignment #1 - My Personal Anthropometric and Nutritional Profile Purpose: To assess individual's personal profile to include BMI risk factors, physical activity, estimated daily calories, and daily amounts...

  • Nutrition: please tell me what the correct answers are I believe all the ones I chose...

    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...

  • Erin is a 28-year-old professional woman who is 5 feet 8 inches tall and maintains her...

    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,...

  • Can you please answer this question with detail? + -/10 points MIntroStat9 7.Ε.034 Since previous studies...

    Can you please answer this question with detail? + -/10 points MIntroStat9 7.Ε.034 Since previous studies have reported that elite athletes are often deficient in their nutritional intake (for example, total calories, carbohydrates, protein), a group of researchers decided to evaluate Canadian high-perfornance athletes. A total of n 324 athletes from eight Canadian sports centers participated in the study. One reported finding was that the average caloric intake among the n 201 women was 2403.7 kilocalories per day (kcal/d). The...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT