Review JavaScript Fundamentals by Building a Gradebook App - Step 4

Tell us what’s happening:

I need help whit this lesson please, i dont know >

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) {
totalScores, studentScore
}
console.log(studentMsg([92, 88, 12, 77, 57, 100, 67, 38, 97, 89], 37));

// User Editable Region


Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) 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

Take a moment to think about what the problem is about .

The task is to return a message

If the student passed the course, the message should follow this format

Class average: average-goes-here. Your grade: grade-goes-here. You passed the course.

if the student failed the course, then the message should follow this format

Class average: average-goes-here. Your grade: grade-goes-here. You failed the course.

The first thing you need to figure out is how to check if a student passed the course or not.
Look back at the code you wrote so far, and see if there is a function to help you with that.

If the student passes the course, then you need to return the first message mentioned here

Class average: average-goes-here. Your grade: grade-goes-here. You passed the course.

You need to replace average-goes-here with the actual class average.
How do you get that?
Look at the tips mentioned in the lesson to help you

That is the start of solving this problem.
I will leave the rest up to you.

But that is how you break down a problem.
You break it down into small pieces and tackle it one piece at a time, and slowly code it out.

That is programming.

Breaking problems down and solving them one step at a time until you get to a solution.

Hope that helps