Checkpoint: Grade Calculator
beginner40 min readLesson 11 of 180
Boundary-correct grading with clean concatenation — types, comparisons, and exact output.
The Grade Calculator combines every module-2 idea in one small program.
Write public static String report(String name, int score) that returns
(but does not print!) a line of text:
- Start with the name, then
": ", then the score, then" -> ". - Append the letter grade:
Afor 90+,Bfor 80–89,Cfor 70–79,Dfor 60–69,Fbelow 60. - Also append the percentage as
(NN%)— the score itself, so forreport("Ada", 93)the exact result is"Ada: 93 -> A (93%)".
Everything must be built with final locals where sensible and string
concatenation; the grader compares the exact returned String for several
students, including boundary scores 90, 60, and 59.