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

 

dvermes@scarsdaleschools.org > getLetterGrade
prev  |  next  |  chance

Write a method that returns the letter grade that corresponds to a given numerical grade. For this example, we will assume there are no pluses or minuses in letter grades. Thus, the system we will use in this example is as follows: A is grade >=90, B is 80 <= grade < 90, C is 70 <= grade < 80, D is 65 <= grade < 70, F is grade < 65. Recall that literal char values must be put in single-quotes, so 'A' not A.


getLetterGrade(98.2) → "A"
getLetterGrade(96.9) → "A"
getLetterGrade(47.0) → "F"

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

public char getLetterGrade(double grade) { }

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

Copyright Nick Parlante 2017 - privacy