about | help | code help+videos | done | prefs |
Write a method that rates the likelihood of you catching a fish. If there is no water you cannot catch a fish no matter what, so your rating should be zero if there is no water. If there is water, but you don't have a rod and reel, bait, or fishing skills your rating is a 1. With only water and a rod and reel your rating is 4. Having bait adds three to your rating (unless there is no water). Finally, once your rating is determined from all of the above information, if you have no skills that is your rating, but if you have skills your rating gets doubled. Look at the test data for specific examples. sep9_2016_APSLHL_catchFish(true, true, false, false) → 4 sep9_2016_APSLHL_catchFish(true, false, false, true) → 2 sep9_2016_APSLHL_catchFish(false, false, true, true) → 0 ...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: 220
Copyright Nick Parlante 2017 - privacy