← Years 9–10 Creating Digital Solutions

Logical operators in a flowchart decision

A combined condition in one decision diamond. AND needs both parts true, OR needs just one, NOT reverses it. One diamond with AND matches two diamonds in a row.

Understanding Logical operators in a flowchart decision in Years 9–10 Creating Digital Solutions

What it does: Chaining two Yes checks one after the other gives the same result as joining them with AND in a single diamond. NOT flips the result, so the Yes path is followed only when the user is not logged in. AND needs both parts to be true. OR would let a student through with only one, so the rule would be broken. AND matches two diamonds in a row. You only reach the final Yes if you answer Yes to both questions, one after the other. A diamond can hold a combined condition with AND, OR or NOT. It still has only two exits: Yes and No.

Common mistakes: The rule says both conditions are needed, so the diamond must use AND. With OR, someone aged 13 or over with no permission would still be allowed in. Two diamonds in a row work like AND. You are only allowed if both answers are Yes, so the Yes path of diamond B leads to Allowed. It should be 'B Yes -> Print Allowed'.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 6–132) and word search (Modules 6–132).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
A flowchart must check that a student has a ticket AND has paid. Which design works?
One diamond: has_ticket = Yes AND paid = YesOne diamond: has_ticket = Yes OR paid = Yes
Matches
Diamond: age >= 13 OR has_permission = Yes (meant to need both)
↓
OR was used when both conditions must be true. It should be AND, because OR lets someone through with only one part true.
Applying
Meanings
Term
age >= 13 AND has_permission = Yes
Meaning
A combined condition in one decision diamond. AND needs both parts true, OR needs just one, NOT reverses it. One diamond with AND matches two diamonds in a row.
Practice
START
Testing
Gaps
Decision: age >= 13 permission = Yes
Check Answer
Spots
1Diamond: age>=13 AND perm=Yes
2Diamond: age>=13 OR perm=Yes

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Sea Turtle' badge — Scope Navigator, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. A flowchart must check that a student has a ticket AND has paid. Which design works?
A. One diamond: has_ticket = Yes AND paid = Yes ✓
B. One diamond: has_ticket = Yes OR paid = Yes
AND needs both parts to be true. OR would let a student through with only one, so the rule would be broken.
2. Which flowchart gives the same result as one diamond with: score >= 50 AND attendance >= 80?
A. Two diamonds side by side, where either one can lead to the pass outcome
B. Two diamonds in a row, where the Yes path of the first leads into the second ✓
AND matches two diamonds in a row. You only reach the final Yes if you answer Yes to both questions, one after the other.
3. True or false: A single decision diamond can contain a combined condition like temp > 30 OR is_sunny = Yes.
A. False
B. True ✓
A diamond can hold a combined condition with AND, OR or NOT. It still has only two exits: Yes and No.
4. A diamond uses OR: is_member = Yes OR has_coupon = Yes. When does the flow take the Yes path?
A. When at least one part is true ✓
B. Only when both parts are true
OR needs just one part to be true. Both parts being true also gives Yes, but it is not required.
5. How can you draw OR using two simple diamonds instead of one?
A. Both diamonds have a Yes path that joins the same outcome ✓
B. The Yes path of the first diamond leads into the second diamond
For OR, either Yes path can reach the outcome. Putting one diamond after the other's Yes path makes AND instead.

Match the Pairs

age >= 13 AND has_permission = Yes → One diamond that sends the flow down Yes only when both parts are true
is_weekend = Yes OR is_holiday = Yes → One diamond that sends the flow down Yes when at least one part is true
Two diamonds in a row, where both answers must be Yes to reach the action, can be replaced by one AND diamond → score >= 50 AND attendance >= 80
NOT reverses a question so the Yes path is taken when the original answer would have been No → NOT (is_logged_in = Yes)
Diamond: age >= 13 OR has_permission = Yes (meant to need both) → OR was used when both conditions must be true. It should be AND, because OR lets someone through with only one part true.
Diamond: is_raining = Yes AND is_snowing = Yes (meant to need either) → AND was used when only one condition needs to be true. It should be OR, because AND needs both to be true at once.

Key Term

age >= 13 AND has_permission = Yes
A combined condition in one decision diamond. AND needs both parts true, OR needs just one, NOT reverses it. One diamond with AND matches two diamonds in a row.

Fill in the Blanks

1. Decision: age >= 13 AND permission = Yes
Hint: Type the operator that needs both parts of the condition to be true.
2. Diamond A: member = Yes? Yes -> Discount Diamond B: coupon = Yes? Yes -> Discount One: member = Yes OR coupon = Yes
Hint: Type the operator that gives one Yes path when just one part is true.
3. Decision: NOT is_raining
Hint: Type the operator that reverses the answer to the question.
4. Diamond 1: age >= 13? Yes -> Diamond 2 Diamond 2: permission = Yes? Yes -> Enter One diamond: age >= 13 AND permission = Yes
Hint: Type the operator that matches two diamonds in a row.
5. Decision: temp < 10 OR temp > 35
Hint: Type the operator that is true when either the cold or the hot check is true.

Spot the Error

Question 1
A Diamond: age>=13 AND perm=Yes
B Diamond: age>=13 OR perm=Yes
C No -> Print Entry denied
D Rule: needs BOTH conditions
Line B — The rule says both conditions are needed, so the diamond must use AND. With OR, someone aged 13 or over with no permission would still be allowed in.
Question 2
A Diamond A: age >= 13?
B A Yes -> Diamond B: perm=Yes?
C B No -> Print Allowed
D Any No -> Print Denied
Line C — Two diamonds in a row work like AND. You are only allowed if both answers are Yes, so the Yes path of diamond B leads to Allowed. It should be 'B Yes -> Print Allowed'.
Question 3
A Diamond A: student=Yes?
B A Yes -> Print Discount
C A Yes -> Diamond B: age>=65?
D B Yes -> Print Discount
E B No -> Print Full price
Line C — Line 2 already sends A Yes to Discount. Diamond B should only be reached from the A No path, so this line should be 'A No -> Diamond B: age>=65?'. Together the two Yes paths work like 'student=Yes OR age>=65'.
Question 4
A Input is_raining
B Diamond: is_raining = Yes?
C Yes -> Print Go outside
D No -> Print Take umbrella
Line B — The Yes path prints 'Go outside', so the question must be reversed with NOT. It should be 'Diamond: NOT is_raining = Yes?'. Without NOT, Yes would mean it is raining.
Question 5
A Input temp
B Diamond: temp>=18 AND temp<=25
C Yes -> Print Too hot or cold
D No -> Print Too hot or cold
Line C — When temp is between 18 and 25 both parts of the AND are true, so the Yes path should print 'Comfortable'. Both paths printing the same message means Comfortable would never appear.

Student with a class code? Join your class →