6 kyu

Mix Fruit Juice

631 of 1,253Heathercoraje

Description:

Story

Jumbo Juice makes a fresh juice out of fruits of your choice.Jumbo Juice charges $5 for regular fruits and $7 for special ones. Regular fruits are Banana, Orange, Apple, Lemon and Grapes. Special ones are Avocado, Strawberry and Mango. Others fruits that are not listed are also available upon request. Those extra special fruits cost $9 per each. There is no limit on how many fruits she/he picks.The price of a cup of juice is the mean of price of chosen fruits. In case of decimal number (ex. $5.99), output should be the nearest integer (use the standard rounding function of your language of choice).

Input

The function will receive an array of strings, each with the name of a fruit. The recognition of names should be case insensitive. There is no case of an empty array input.

Example

['Mango', 'Banana', 'Avocado'] //the price of this juice bottle is (7+5+7)/3 = $6($6.333333...)
Fundamentals
Arrays

Stats:

CreatedApr 30, 2017
PublishedApr 30, 2017
Warriors Trained1717
Total Skips28
Total Code Submissions5079
Total Times Completed1253
JavaScript Completions631
Python Completions550
Ruby Completions111
Crystal Completions8
Total Stars35
% of votes with a positive feedback rating92% of 282
Total "Very Satisfied" Votes240
Total "Somewhat Satisfied" Votes39
Total "Not Satisfied" Votes3
Total Rank Assessments12
Average Assessed Rank
6 kyu
Highest Assessed Rank
6 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • Heathercoraje Avatar
  • GiacomoSorbi Avatar
  • Just4FunCoder Avatar
  • farhanaditya Avatar
  • saudiGuy Avatar
Ad