Bummer! This is just a preview. You need to be signed in with a Basic account to view the entire video.
The Conditional Challenge0:53 with Dave McFarland
Use conditional statements to build a multiple question quiz.
Ask at least five questions
Keep track of the number of questions the user answered correctly
Provide a final message after the quiz letting the user know the number of questions he or she got right.
Rank the player. If the player answered all five correctly, give that player the gold crown: 3-4 is a silver crown; 1-2 correct answers is a bronze crown and 0 correct is no crown at all.
Ready for a challenge?
Variables, strings, numbers, and conditional statements.
In fact, you've learned enough to put together complete programs.
For this challenge, I want you to write a simple quiz application.
The application needs to do several things.
First, it has to ask at least five questions.
Second, keep track of the number of questions the user answered correctly.
Third, provide a final message after the quiz,
letting the user know the number of questions he or she got right.
And fourth, rank the player.
If the player answered all five correctly, give that player the gold crown.
Three to four is a silver crown.
One to two correct answers is a bronze crown.
And zero correct is no crown at all.
In the next video I'll show you how I would program this challenge.
You need to sign up for Treehouse in order to download course files.Sign up