Build a Gradebook App - Build a Gradebook App

Tell us what’s happening:

i don’t understand why the test 19 is false and the 20 is true?

Your code so far



const getAverage = (array) => {

let sum = 0; 

  for (let i=0 ; i<array.length ; i++){

  sum += array[i];

  }
return sum/array.length;
}
console.log(getAverage([92, 88, 12, 77, 57, 100, 67, 38, 97, 89])) 


const getGrade = (score) =>{

  if (score <= 59){
    return "F";
  }
  if (score <= 69){
    return "D";
  }
  if (score <= 79){
    return "C";
  }
  if (score <= 89){
    return "B";
  }
  if (score <= 99){
    return "A";
  }
  if (score === 100){
    return "A+";
  }
}

const grade = getGrade();


const hasPassingGrade = (grade) => {

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

Your browser information:

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

Challenge Information:

Build a Gradebook App - Build a Gradebook App

Does your code meet the requirements for User Story #3 and #4?

i attemp to use getGrade function to get the letter grade

Yes. You should use getGrade inside hasPassingGrade to get the letter grade. Also, please make sure you are defining the requested parameter for hasPassingGrade.

thank you, it’s working.

1 Like