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

 

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

Write a method that returns the "grade" of beef based on the following information. (I made all this up... I have no idea how beef is really graded) Beef is graded based on a score of 0 through 6 for the overall quality of the beef. However, if the beef is also tender, the score gets a bonus of 2 extra points. So beef with a score of 3 that is tender will have a total score of 5 (after the bonus points). The grades are then assigned based on the following... 3="B", 4="B+", 5="A", 6="A+", 7="AA". Any score under 3 will be an "F". Also, the total score will never be over 7. The minimum possible score is zero. Return the "grade" of the beef as a string of one or two letters.


gradingBeefAdvanced1(true, 2) → "B+"
gradingBeefAdvanced1(true, 5) → "AA"
gradingBeefAdvanced1(false, 7) → "AA"

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

public String gradingBeefAdvanced1(boolean tender, int score) { }

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

Copyright Nick Parlante 2017 - privacy