Question
Function name : feast() Parameters : num_apples (int), num_grapes (int), num_oranges (int), activity_level (string) Returns: a boolean Description : You love to eat mega-fruit, but
Function name : feast()
Parameters : num_apples (int), num_grapes (int), num_oranges (int), activity_level (string)
Returns: a boolean
Description : You love to eat mega-fruit, but you also want to eat in moderation. You know that a mega-apple has 507 calories, a mega-grape has 23 calories, and a mega-orange has 296 calories. The activity level can either be sedentary, moderate, or active. You know that people with a sedentary activity level should eat about 2300 calories in a day, people with a moderate activity level should eat about 2500 calories in a day, and people with an active activity level should eat about 2700 calories in a day (source: https://health.gov/dietaryguidelines/2015/guidelines/appendix-2/ ). Calculate whether the number of each type of mega-fruit you want to eat today lies within the caloric limits based on your activity level! If the calories in all the mega-fruit youre eating is less than or equal to the number of daily calories for your activity level, return True. Otherwise, return False.
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