java · level 1 check
a tiny quiz game.
Time to build a real game! Your quiz asks three questions, one after another. It reads each answer from the keyboard, keeps score, and tells the player how they did at the end.
The questions and answers live in two arrays, side by side. The method `isRight` takes a guess and the real answer, and returns `true` or `false`. A `for` loop counts through the indexes, so `questions[i]` and `answers[i]` always match up.
Be kind to your player: `MARS`, `mars` and `Mars` with extra spaces should all count as right. Fill in each `____`, run it, then play your own quiz.
Fill in every ____ then run the checks.
- 1 It asks every questionuses: loops
- 2 It accepts any capitalsuses: text tricks
- 3 It ignores extra spacesuses: text tricks
- 4 It counts the score correctly when some answers are wronguses: variables
- 5 It tells the player the right answer after a mistakeuses: arrays
- 6 It only cheers a perfect scoreuses: decisions
Take as long as you like and try as many times as you want.
java · 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.