Afrikaans
Akan
Albanian
Amharic
Arabic
Armenian
Azerbaijani
Basque
Belarusian
Bemba
Bengali
Bihari
Bosnian
Breton
Bulgarian
Cambodian
Catalan
Cebuano
Cherokee
Chichewa
Chinese (Simplified)
Chinese (Traditional)
Corsican
Croatian
Czech
Danish
Dutch
English
Esperanto
Estonian
Ewe
Faroese
Filipino
Finnish
French
Frisian
Ga
Galician
Georgian
German
Greek
Guarani
Gujarati
Haitian Creole
Hausa
Hawaiian
Hebrew
Hindi
Hmong
Icelandic
Igbo
Indonesian
Interlingua
Irish
Italian
Japanese
Javanese
Kannada
Kazakh
Kinyarwanda
Kirundi
Kongo
Korean
Krio (Sierra Leone)
Kurdish
Kurdish (Soranรฎ)
Kyrgyz
Laothian
Latin
Latvian
Lingala
Lithuanian
Lozi
Luganda
Luo
Luxembourgish
Macedonian
Malagasy
Malay
Malayalam
Maltese
Maori
Marathi
Mauritian Creole
Moldavian
Mongolian
Myanmar (Burmese)
Montenegrin
Nepali
Nigerian Pidgin
Northern Sotho
Norwegian
Norwegian (Nynorsk)
Occitan
Oriya
Oromo
Pashto
Persian
Polish
Portuguese (Brazil)
Portuguese (Portugal)
Punjabi
Quechua
Romanian
Romansh
Runyakitara
Russian
Samoan
Scots Gaelic
Serbian
Serbo-Croatian
Sesotho
Setswana
Seychellois Creole
Shona
Sindhi
Sinhalese
Slovak
Slovenian
Somali
Spanish
Spanish (Latin American)
Sundanese
Swahili
Swedish
Tajik
Tamil
Tatar
Telugu
Thai
Tigrinya
Tonga
Tshiluba
Tumbuka
Turkish
Turkmen
Twi
Uighur
Ukrainian
Urdu
Uzbek
Vietnamese
Welsh
Wolof
Xhosa
Yiddish
Yoruba
Zulu
Hope you had fun building the quiz, if you solved it, then you're on fire if you had some trouble.
Not a problem.
We can go over it now.
And we're going to use again, next line to pick up each answer, so string answer one.
Is equal to Skender next line.
And we'll copy this three times.
And don't forget to rename each variable.
And now scandal next line picks up each answer and stores it in a variable, easy enough.
The next task is to check each answer, and so these are starts with a score of zero and using if statements
you can compare each answer against the correct one will say if an answer one is correct, epiphytic
will see.
In which case, update their score by five and if answer two equals a.
We're going to add five as well, if answer three equals D.
Update their score by five.
And remember that the final answer can be a oraibi, so we'll check if answer four is equal to a.
If answer four is equal to be.
In which case, we're going to update the number of points by five and you'll notice that each statement
looks pretty much the same, if their answer matches the correct one, the condition turns true.
The code runs to update the score by an additional five points.
Easy enough.
And the last task was to print a message that depends on the user score.
So if they score 15 or higher, if score is bigger than or equal to 15.
We're going to print wow, you know, your stuff.
If that's false, we'll say else if the check if there scores five and higher, but less than 15.
If their score is in the range of five and 15 will print, not bad.
And if even that's false, then the score is obviously less than five, in which case we're going to
print better luck next time.
They were ready to run our code.
And I'll enter the correct answers, see?
Here we can write A or B, does it matter and what happened?
It seems my number three is incorrect.
The answer should be D was tricked by my own quiz.
All right.
I'll rerun my code now.
Keep my answers the same, but I'll put a D here.
And there you go, my output is a perfect score, Prince, the right message.
Final task is to run some test cases to really test our code and make sure that it's robust.
So I'm going to rerun the quiz with three wrong answers and only one correct answer.
B, C, D, c.
And because they got three wrong, I get a five out of 20 and a not that good.
That's true on the quiz with the wrong answers to every question.
And I get a zero.
OK, so everything is working out well so far this time I'll make sure the first two are correct and
the last two are wrong.
As I expected, 10 out of 20, not bad at all.
After testing my code, it seems to work well.
I hope you had fun taking on this challenge.
That's all for booleans and conditionals.
I'll see you in the next section functions.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.