id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

jebbert@volusia.k12.fl.us > sep9_2016_APSLHL_catchFish
prev  |  next  |  chance

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)

public int sep9_2016_APSLHL_catchFish(boolean water, boolean rodAndReel, boolean bait, boolean skills) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 220

Copyright Nick Parlante 2017 - privacy