Tell us what’s happening:
Im very lost on this step please help. i have tried several different ways
Your code so far
function getAverage(scores) {
let sum = 0;
for (const score of scores) {
sum += score;
}
return sum / scores.length;
}
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";
}
// User Editable Region
function studentMsg(totalScores, studentScore) {
}
console.log(studentMsg([92, 88, 12, 77, 57, 100, 67, 38, 97, 89]
// User Editable Region
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36
Challenge Information:
Review JavaScript Fundamentals by Building a Gradebook App - Step 4
We can help you move forward. First though, please tell us what you believe the function that you need to fill out is supposed to do. The more details you put in your explanation the more we can help you fix anything that you have misunderstood.
it should return the message "class average 71.1 your grade F you failed the course
This is the studentMsg function you are supposed to fill out.
So step 1, what do you think the totalScores variable is and the studentScore variable is.
And, step 2, what do you think studentMsg is supposed to do with these?
well obviously totalscores is 717 so when you divide that by the total scores you get 71.7 which is their average and the students grade as shown is a 37.
try to just think in terms of totalScores and studentScore.
What type of thing is totalScores?
What type of thing is studentScore.
(forget about the example)
totalScores is the sum of the given grades
studentsScore is the grade they received for the course.
Thats what i think they mean
we’re making progress.
One way to check your statement is by now looking at the example they gave.
here it is:
console.log(studentMsg([92, 88, 12, 77, 57, 100, 67, 38, 97, 89], 37));
Does this example prove or disprove your statements (or neither)?
im not sure. thats the problem
try to look at the console.log line more closely.
Do you see two arguments being passed into studentMsg function?
Split them up. What’s the first one look like? What’s the second one?
got it figured out thank you 
1 Like