Okay, let's do some more practice with the control structures you've learned so far!
We've seen how if
, else if
, and else
help our programs make decisions and choose different paths.
Engagement Message
What's the main job of these conditional statements?
Remember we also looked at combining checks using logical operators?
&&
requires both conditions to be true, while ||
only needs one. !
reverses the truth value.
Engagement Message
When would a condition using &&
evaluate to false
?
Type
Fill In The Blanks
Markdown With Blanks
Time for practice! Fill in the blanks to check if a person qualifies for a special discount: they must be over 60 or have a valid member card and not be on a restricted list.
Suggested Answers
- &&
- ||
- !
- ==
