Grade with Plus or Minus
hardQuestion 252The variable score is a test result from 0 to 100. Print the letter grade with a modifier. First decide the letter as usual: A for 90 and above, B for 80 to 89, C for 70 to 79, D for 60 to 69, F below 60. Then, for the letters B, C and D only, look at the last digit of the score (score % 10): 7 or more adds +, 2 or less adds -, anything else adds nothing. A and F never get a modifier. Build the result in a variable called grade and print it on its own.
Expected output
B+= newline. The output ends with a newline, so print one after the last line.
Hints4 available
Sign in to use hintsTopics
If Statements
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (clog, fn, fori)
Your output
Run your code to see the output here...
Test cases
Run your code to see test case results.