Alice Programming
Learn Alice in FREE step-by-step lessons.
Quiz on Boolean Expressions: true or false
After doing all parts of the lesson you should be able to answer these questions.
Write down the answers first. Click the to check your answer.
1. A Boolean variable can have what values?
true or false
2. How do you ask the user a true false question?
The function getBooleanFromUser gives a choice of true or false.
3. How do you use a Boolean value?
Drag in an if tile and change the comparison
4. When you have an if do you have to put something in the else section?
No, the else is optional.
5. What does && mean?
AND: both parts have to be true
6. What does || mean?
OR: either or both parts must be true
7. How do you count the number of question the user gets right?
Set count to 0 to start, use count=count+1 whenever they get an answer right.
8. What does != mean?
Not Equal
9. Which of these two comparisons would be true if a student got a B:
grade>=80 && grade<90
grade>=80 || grade<90
The first one, the second one will always be true.
Please review the material for any questions you miss.