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

 

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

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)

public int okraYumminess(boolean wasFresh, int rating, int daysPastPrime) { }

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

Copyright Nick Parlante 2017 - privacy