I need help

I learn course Full-Stack engineer! But i can’t complete once task.

finalGrade()

Instructions

1.

Write a function, finalGrade() . It should:

  • take three arguments of type number
  • find the average of those three numbers
  • return the letter grade (as a string) that the average corresponds to
  • return ‘You have entered an invalid grade.’ if any of the three grades are less than 0 or greater than 100

0-59 should return: 'F'
60-69 should return: 'D'
70-79 should return: 'C'
80-89 should return: 'B'
90-100 should return: 'A'

HELP ME PLEASE!
i try complete it for a week!

Hello @5311118096, welcome to the forums! Could you please post your code? To format it correctly, see ->this<- post.


onst finalGrade = (...a) => {

02

if(a.some(a => a < 0 || a > 100)) return `вы ввели недопустимую оценку.`;

03

a = a.reduce((a,b)=> a + b) / a.length;

04

let i = 1;

05

for ( ; i < 6; i++) {

06

if(a >= (100 - 10 * i)) break;

07

}

08

return String.fromCharCode(64 + i)

09

}

10

console.log(finalGrade(60, 70, 50)) 

i try do it how in instruction but what should I do about it.

OMG i’m STUPID((((

Could you post a link to the exercise, please?

Link
I know what this code don’t correct(((

Should onst be const?(I’m sure that’s just a matter of copy/paste!)


Aside. There’s nothing actually wrong with your code-it definitely performs the given task. It’s just that CC wants the exact text 'You have entered an invalid grade.' (in English), so if you just change the line where you say that in (Russian, is it?) to the English sentence, it should pass.

const variable! onst do not in code.

1 Like

OMG it is easy. I definitely STUPID)))
Thank you!

1 Like