๐ WAYPOINT LESSON
Checkpoint: Grade Calculator
โญ beginnerโณ 40 min read๐ Lesson 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.