Checkpoint: Grade Calculator
Challenge on lesson: Checkpoint: Grade Calculator
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.
Back to lesson: Checkpoint: Grade Calculator