php · level 1 check
a sports day score board.
Sports day is over and the scores are in! Build the score board. It shows every player in capitals with their points and a medal, then the top score and the team total.
The names and scores live in two arrays, side by side. A `for` loop uses an index to grab each name and its matching score. The function `medal` takes a score and returns gold for 90 or more, silver for 70 or more, and bronze for the rest.
Fill in each `____`, run it, and check every line of the board. Then change the scores and test it again.
Fill in every ____ then run the checks.
- 1 Every player is on the board, in capitalsuses: text tricks
- 2 90 or more wins golduses: decisions
- 3 70 to 89 wins silveruses: decisions
- 4 Under 70 wins bronzeuses: functions
- 5 It finds the top scoreuses: searching
- 6 It adds up the team totaluses: loops
Take as long as you like and try as many times as you want.
php · level 1 · easy
level up.
You passed every check. Your face is now :D, and Level 2 gets you B).
- 28 lessons in this level
- 6 of 6 checks passed
This pass isn’t saved. A free account keeps your new face.