Build two score reports while keeping each value in the narrowest useful scope.
Write createScoreReport(name, scores). Use the global bonus, a function-local total, and a loop-local score. Add the bonus after the loop. Inside an if/else, use a block-scoped level to build a result label: totals of at least 20 are Advanced, otherwise Learning. Return the label and display reports for both supplied players.
Which values must still be available after the loop and each branch?