Not sure what I did wrong in this line of code. My console logs the accurate message but im still getting a message saying my code needs more work.
function studentMsg(totalScores, studentScore) {
if(hasPassingGrade(studentScore)){
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) )
hi there!
add three back ticks in a seperate line, before and after your code. also add link to the challenge step within the topic.
function studentMsg(totalScores, studentScore) {
if (hasPassingGrade(studentScore)) {
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));
Hi! Okay. Please let me know if this is what you mean.
Blockquote
ILM
7
actual: Class Average: 71.7. Your grade: F. You failed the course.
expected: Class average: 71.7. Your grade: F. You failed the course.
do you see the difference?
capitalization issue. Average
first latter in both retrun statment.
WOWW. i was stuck on this for 40 mins because of this. Thank you so much.
2 Likes
system
Closed
10
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.