Beginner
Grade calculator
Finish grade(score). It returns "A" for 90 to 100, "B" for 75 up to (not including) 90, "C" for 50 up to 75, and "F" for 0 up to 50.
Scores below 0, above 100, or not a number at all (NaN) must return "invalid".
The button is already wired up: type a score and press Grade it to see the result on the page.
What Check tests
- 90 to 100 is an A
- 75 up to 90 is a B (89.9 is still a B)
- 50 up to 75 is a C, below 50 is an F
- Out-of-range scores and NaN are "invalid"
- The button shows the grade on the page
Stuck? One hint at a time
The solution unlocks after your first Check. Try first: that is where the learning happens.
Runs in your browser. Your code is saved here.
Your page
Press Run to see the page.
Console
Nothing logged yet.