about | help | code help+videos | done | prefs |
Write a method that returns the yumminess of a batch of okra. The yumminess is based on the okra's rating, how many days past it's prime it is, and if it was picked fresh or not. The yumminess factor starts out as the okra's rating. For every day past it's prime, the yumminess factor goes down by one. However, if it was picked fresh it gets two bonus points. The lowest possible yumminess factor is zero, so if your calculations produce a final value less than zero, just return a zero. Look at the test data for examples. okraYumminess(true, 7, 2) → 7 okraYumminess(true, 12, 5) → 9 okraYumminess(false, 12, 5) → 7 ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 240
Copyright Nick Parlante 2017 - privacy