Question: Biggest Beet Function Name: dwightsBeets ( ) Parameters: beetDiameter ( str ) Returns: message ( str ) Description: Acclaimed beet enthusiast Dwight Shrute wants to

Biggest Beet
Function Name: dwightsBeets()
Parameters: beetDiameter ( str )
Returns: message ( str )
Description: Acclaimed beet enthusiast Dwight Shrute wants to keep track of his seasonal beet harvests.
Create a function called dwightsBeets() that takes in one parameter, beet diameters seperated by commas ( str ), and calculates their average of the numbers. If the average beet diameter is less than 2 inches, print the string: "Better luck next year!" . If the average beet diamter is greater than 5 inches, print the string: "Wowee, what a haul!" . Finally, your function should return the string "Avg diameter of this harvest is {avgDiameter} inches and biggest beet is {longestDiameter} inches". Be sure that the average diameter is rounded to two decimal places.
> dwightsBeets("2,1,4,3,2,1,4,5,2,5")
"Avg diameter of this harvest is 2.9 inches and biggest beet is 5 inches"
Biggest Beet Function Name: dwightsBeets ( )

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!