Assignment
Create a grade calculator program that:
- Creates an array of at least 5 student names
- Creates a corresponding array of their grades (numbers between 0-100)
- Creates a function called
getLetterGradethat:- Takes a numeric grade as parameter
- Returns a letter grade based on:
- A: 90-100
- B: 80-89
- C: 70-79
- D: 60-69
- F: below 60
- Creates a function called
calculateClassAveragethat:- Takes an array of grades as parameter
- Returns the average of all grades
- Uses a
forloop to display each student's name, numeric grade, and letter grade - Displays the class average at the end
- Uses
filterto find and display only students who passed (grade >= 60)
Requirements:
- Use arrays for storing student names and grades
- Use functions with parameters and return values
- Use for loops, filter, and template literals
- Use an external JavaScript file (script.js) linked to your HTML
- Display results using both console.log() and document.write()
Create an index.html file and a script.js file with your solution.