The Rank Master
EasyAcc. 95.4%
+20 XP 8
The Judgement Ladder
When an simple binary choice isn't enough, we use the else if ladder. This allows you to check multiple ranks in order of priority. The moment your code finds a match, it takes it and ignores the rest of the ladder.
The Assignment
Your function receives a score. You must judge their rank:
- 90+: You belong in "Grade A"
- 80+: You belong in "Grade B"
- 70+: You belong in "Grade C"
- Anything else: You belong in "Grade F"
01EXAMPLE 1
Input
score = 85Output
Logs: "Grade B"Explanation: 85 is not >= 90, but it is >= 80.
02EXAMPLE 2
Input
score = 65Output
Logs: "Grade F"Explanation: 65 fails all conditions down to the final else.
Constraints
- Use an if-else if-else structure.
- Log messages must match exactly.
Control FlowConditionalsFundamentals
JavaScriptSystem handles I/O — write your function only
Loading...
5 Hidden
Input Arguments
score80
Expected Output
Grade B
Click RUN to test your solution