Build a Gradebook App - Build a Gradebook App

Tell us what’s happening:

function studentMsg(scores, studentScore) {
const average = getAverage(scores);
const grade = getGrade(studentScore);
const passed = hasPassingGrade(studentScore);
return Class average: ${average}. Your grade: ${grade}. You ${passed ? "passed" : "failed"} the course.;
} there is the 22 statement problem please help, after trying it several times the error is not gone

Your code so far

function getAverage(scores) {
  const sum = scores.reduce((a, b) => a + b, 0);
  return Number((sum / scores.length).toFixed(1));
}

function getGrade(score) {
  if (score === 100)         return "A+";
  else if (score >= 90)     return "A";
  else if (score >= 80)     return "B";
  else if (score >= 70)     return "C";
  else if (score >= 60)     return "D";
  else                      return "F";
}

function hasPassingGrade(score) {
  return getGrade(score) !== "F";
}

function studentMsg(scores, studentScore) {
  const average = getAverage(scores);
  const grade = getGrade(studentScore);
  const passed = hasPassingGrade(studentScore);
  return `Class average: ${average}. Your grade: ${grade}. You ${passed ? "passed" : "failed"} the course.`;
}

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36

Challenge Information:

Build a Gradebook App - Build a Gradebook App

The instructions don’t ask you to format the result.

studentMsg([92, 88, 12, 100, 67, 38, 97, 89], 37) should return the following message: Class average: 72.875. Your grade: F. You failed the course.

Test what your function does

got it i didn’t thought that the editor want the formatting part. thank you