This is a JavaScript final assessment. Implement the task in experiments.js and use console.log to show results in the browser console.

Setup

If you don't already have the experiments project, create a simple HTML page that loads experiments.js:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <title>JavaScript Final Assessment</title>
  </head>
  <body>
    <script src="./experiments.js"></script>
  </body>
</html>

Assessment

Build a small student grade manager in experiments.js that accepts an array of student objects (each with name, city, and scores) and prints a clear class summary. Your program should:

  • Compute each student's average and letter grade.
  • Print a readable line for every student (name, city, average, grade).
  • Print the number of students on the honor roll (average >= 85).
  • Print the overall class average (rounded to one decimal place).
  • Print the name of the top student (highest average).

Do not mutate the original students array; use array methods (map, filter, reduce) where appropriate.

Answer