Help with the finalGrade

Hi all
my code is working fine on a online editor, but does not here:

function finalGrade(num1, num2, num3) {
  if ((num1 < 0 || num1 > 100) || (num2 < 0 || num2 > 100) || (num3 < 0 || num3 > 100)) {
    return 'You have entered an invalid number';
  }
  const average = (num1 + num2 + num3) / 3;
  if (average < 60) {
    return 'F';
  } else if (average < 70) {
    return 'D';
  } else if (average < 80) {
    return 'C';
  } else if (average < 90) {
    return 'B';
  } else {
    return 'A';
  }
}

console.log(finalGrade(50, 100, 70));

What could be wrong??

can you provide:

the exercise url
the error message

https://www.codecademy.com/paths/web-development/tracks/getting-started-with-javascript/modules/code-challenge-javascript-fundamentals/lessons/javascript-fundamentals-code-challenge/exercises/final-grade

strings returned need to be an exact match, I recommend copy pasting the string from the instructions. Seems you forgot a full stop at the end of your string/sentence.

2 Likes

yes, spot on, final it accepted as good result, thank you :smiley: :smiley:

1 Like