Hello, I’ve been attempting to work on this code for a while but still don’t understand where I’ve gone wrong.
This is my code:
function studentMsg(totalScores, studentScore) {
if (getAverage >= 60 || hasPassingGrade == true) {
return ("Class average: " + getAverage(totalScores) + "." + " Your grade: " + getGrade(studentScore) + "." + " You passed the course.")
} else {
return ("Class average: " + getAverage(totalScores) + "." + " Your grade: " + getGrade(studentScore) + "." + " You failed the course.")
}
}
console.log(studentMsg([92, 88, 12, 77, 57, 100, 67, 38, 97, 89], 37));
console.log(studentMsg([56, 23, 89, 42, 75, 11, 68, 34, 91, 19], 100));
This is the error I keep getting:
// running tests
Your function call of studentMsg([56, 23, 89, 42, 75, 11, 68, 34, 91, 19], 100) should return the following message:
"Class average: 50.8. Your grade: A++. You passed the course.".
Your studentMsg function should return the correct message based on the student's score and the class average.
// tests completed
// console output
Class average: 71.7. Your grade: F. You failed the course.
Class average: 50.8. Your grade: A++. You failed the course.
Is there something wrong with my conditional statement? Please explain .