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

 

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

For every one pound of okra you need a minimum of one quart of cooking oil to fry the okra. However, you have a very strange fryer that only accepts oil on whole gallon amounts. So to fry 1, 2, 3, or 4 pounds of okra, you need ONE WHOLE GALLON of oil. To fry 5 pounds, you really only need 5 quarts, but because of your strange fryer you have to use two gallons. Given the number of pounds of okra you want to fry, return how many gallons of oil you need to put in your fryer.


okraFry(1) → 1
okraFry(3) → 1
okraFry(4) → 1

...Save, Compile, Run (ctrl-enter)

public int okraFry(int poundsOkra) { }

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: 250

Copyright Nick Parlante 2017 - privacy