Lesson details

Key learning points

  1. In this lesson, we will deepen our understanding of logical expressions by introducing the operators AND and OR. It will begin with a Parson's Problem to check our understanding of selection. It will then move on to an unplugged activity that introduces AND and OR. We will walk through code, and investigate it before writing our own logical expressions.

Licence

This content is made available by Oak National Academy Limited and its partners and licensed under Oak’s terms & conditions (Collection 1), except where otherwise stated.

Loading...

2 Questions

Q1.
If you want to increase the value held in the score variable by 1, which line of code should you use?
score + 1
score = 1
score = 1 + 1
Correct answer: score = score + 1
Q2.
What does this logical operator represent? !=
Equal to
Less that or equal to
More than or equal to
Correct answer: Not equal to

3 Questions

Q1.
If the user enters the colour: red and the suit: spades. What will the output be of this program?
An image in a quiz
My card is a match
Correct answer: My card is not a match
Q2.
If the user enters the colour: black and the suit: hearts. What will the output be of this program?
An image in a quiz
Correct answer: My card is a match
My card is not a match
Q3.
If the user enters the colour: black and the suit: diamonds. What will the output be of this program?
An image in a quiz
My card is a match
Correct answer: My card is not a match