Reformat · Easy
Marks to grades
Marks out of 100 must become grades: A 90 and above, B 75–89, C 60–74, D 40–59, F below 40.
Task
Write a prompt that gives each student their grade.
Output format
<Name>:<Grade>, one per line
- Same order as the input.
Your prompt must contain {input}: it is replaced by each test case, just like the hidden tests in a hiring test.
Sample case 1
Input
Ali: 92 Ben: 74
Output
Ali:A Ben:C
Sample case 2
Input
Maya: 90 Tom: 75 Sam: 60 Zoe: 40
Output
Maya:A Tom:B Sam:C Zoe:D
There are 4 test cases in all; the others are like hidden tests: work out what tricky inputs they might use!