Review JavaScript Fundamentals by Building a Gradebook App - Step 4

Tell us what’s happening:

Given it my best effort but I cannot decide what terms the system wants me to concatenate.

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) {
const average = getAverage(totalScores);
const grade = getGrade(studentScore);
const passOrFail = studentScore >= average ? 'passed' : 'failed';
return "Class average: ${average}." + "Your grade: ${grade}." + "You ${passOrFail} the course.'";
}
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/128.0.0.0 Safari/537.36 Edg/128.0.0.0

Challenge Information:

Review JavaScript Fundamentals by Building a Gradebook App - Step 4

Take a closer look at the sentence they asked you to create. It has spaces at certain spots. Your version is missing those spaces.

You also can’t use interpolation ${} outside a template literal.

`${someVar}`

Some general feedback to the forum moderators: This forum is so not helpful. The problem is looking for very specific answers and there are many ways to complete these problems. In addition, I am a nurse not a coder, I am trying to learn but the prescribed vagueness and refusal to show how to do things is frustrating in the extreme. The Bing AI is infinitely more helpful.

This project isn’t looking for a specific syntax but rather a specific result.

Also, we can’t write answers for you and it wouldn’t help if we did. It would only give you a green checkmark on one step instead of understanding on how to do the problem.

AI can be helpful, but I would not ask it to write code for you, and since it guesses words to put together I would always check what it says for correctness.

It is true that we are not helpful in the traditional sense of the word (if the meaning is that we should show people what to do each time they ask).
We offer help in hints instead because in coding the computer cannot tell us when we are doing something wrong. It just doesn’t have that capability.
We, as coders, have to rely on hints that come in the form of syntax errors, or weird behaviour, and try to work out the causes from that. Almost like a detective trying to find a murderer: that person will not be confessing or pointing out any clues. The detective has to use all their senses and their tools to help themselves.