Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems For Advanced Applications 27th International Conference Dasfaa 2022 Virtual Event April 11 14 2022 Proceedings Part 2 Lncs 13246

Authors: Arnab Bhattacharya ,Janice Lee Mong Li ,Divyakant Agrawal ,P. Krishna Reddy ,Mukesh Mohania ,Anirban Mondal ,Vikram Goyal ,Rage Uday Kiran

1st Edition

3031001257, 978-3031001253

Students also viewed these Databases questions