Build a Gradebook App - Build a Gradebook App

Tell us what’s happening:

Not sure why my code fails test number 19? It works correctly, returns true if grade is passing and false if grade is not passing.

Your code so far

function getAverage(array)
{
  let sum = 0;
  for(let i = 0; i < array.length; i++)
  {
    sum += array[i];
  }
  let average = sum/array.length
  console.log(average);
  return average;
}

getAverage([92, 88, 12, 77, 57, 100, 67, 38, 97, 89]);

function getGrade(score)
{
  if(score <= 59)
  {
    console.log("F")
    return "F";
  }
  else if(score >= 60 && score <= 69)
  {
    console.log("D")
    return "D";
  }
  else if(score >= 70 && score <= 79)
  {
    console.log("C")
    return "C";
  }
  else if(score >= 80 && score <= 89)
  {
    console.log("B")
    return "B";
  }
  else if(score >= 90 && score <= 99)
  {
    console.log("A")
    return "A";
  }
  else if(score === 100)
  {
    console.log("A+")
    return "A+";
  }
  else
  {
    return "Invalid";
  }

}

let gradeToTest = 80;

function hasPassingGrade(grade)
{
  if(grade === "F")
  {
    console.log("false");
    return false;
  }
  else if(grade != "F")
  {
    console.log("true");
    return true;
  }
  else
  {
    console.log("Invalid");
  }
}

hasPassingGrade(getGrade(gradeToTest))

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36

Challenge Information:

Build a Gradebook App - Build a Gradebook App
https://www.freecodecamp.org/learn/full-stack-developer/lab-gradebook-app/build-a-gradebook-app

What do the instructions say is the argument to hasPassingGrade()?

It just says it should return a boolean value

That’s not what I asked though. What is the input?

The instructions do say what the input has to be, and it doesn’t agree with what you’ve codef up.

It doesn’t at least not as far as I can tell. It just says it should return true if the grade is passing, and false if the grade is failing (an F) which my code does, but it still fails the test.

Your browser is not showing this information?

You should have a function named hasPassingGrade that takes a score as a parameter and returns either true or false depending on if the score corresponds to a passing grade.

If that is not on your version of the instructions, then something is very wrong.