Skip to main content
๐Ÿ“œ 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: A for 90+, B for 80โ€“89, C for 70โ€“79, D for 60โ€“69, F below 60.
  • Also append the percentage as (NN%) โ€” the score itself, so for report("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.