696 B
696 B
Hints
1. Translate a numeric grade to a letter grade
- Use an
if-then-else
expression with as manyelif
branches as needed.
2. Count the number of students for each letter grade
- The
reduce
filter needs a stream to iterate over. The input is an object. Use theto_entries
expression to transform the object into an array. - The result object must have all the possible letter grades as keys, even if no students earned that grade.
- The
+=
assignment will be useful.