Message student with results. Step 4

function studentMsg(totalScores, studentScore) {
const average = getAverage(totalScores);
const grade = getGrade(studentScore);
const passingMessage = hasPassingGrade(studentScore) ? “You passed the course.” : “You failed the course.”;

return `Class average: ${average.toFixed(1)}. Your grade: ${grade}. ${passingMessage}`;

}

// Test case
console.log(studentMsg([92, 88, 12, 77, 57, 100, 67, 38, 97, 89], 37));
Tell how to solve below error happened with this,
Your studentMsg function should return the correct message based on the student’s score and the class average.

Hi there!

Remove the toFixed() method. You are not asked to round the grade marks

1 Like

Thank you. It worked for me.

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.