← ACARA Digital Technologies Years 9–10

Turning a worded rule into AND, OR and NOT

Key words in a worded rule signal the operator: both/and means AND, either/or means OR, not/unless/except means NOT. Use them to rewrite the rule as a compound condition.

Understanding Turning a worded rule into AND, OR and NOT in ACARA Digital Technologies Years 9–10

What it does: 'Unless', 'not' and 'except' signal NOT, so the condition about the bag being empty is negated. 'Between' means both limits must hold, so two relational conditions are joined with AND. Each uses the variable name in full. The key word "both" signals AND. Both parts must be true at the same time. "Either / or" signals OR. Just one of the conditions being true is enough to close the pool. The words 'either ... or' signal OR, so the whole condition is true when at least one of the two parts is true. Written like this, OR makes the test true for almost any age. Use age >= 13 AND age <= 19 to match 'between'.

Common mistakes: The rule says BOTH the age condition and the pass condition must be true, so the operator must be AND. With OR, someone with a pass but under 13 would get in. The rule says EITHER an order over $50 OR a VIP gets free shipping. Either/or means OR. With AND, a VIP with a small order would be charged.

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 492–534) and word search (Modules 459–534).

Take this worksheet further — free with Cloodit

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

Learning
Duo
Rule: "You can enter if you are both over 12 and have a ticket." Which condition matches?
age > 12 AND hasTicket = TRUEage > 12 OR hasTicket = TRUE
Matches
IF age < 13 OR age > 19 THEN // rule: between 13 and 19
↓
The rule 'between 13 and 19' means both limits must hold, so it needs AND, not OR. Also the comparisons are reversed, as this tests for outside the range.
Applying
Meanings
Term
both = AND, either = OR, not = NOT
Meaning
Key words in a worded rule signal the operator: both/and means AND, either/or means OR, not/unless/except means NOT. Use them to rewrite the rule as a compound condition.
Practice
IF (hasPass OR hasTicket) AND NOT banned THEN
Testing
Gaps
IF maths >= 50 english >= 50 THEN
Check Answer
Spots
1INPUT age, ok
2IF age >= 13 OR ok = 1 THEN

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

The 'Lion's Mane Jellyfish' badge — Set Operator, 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. Rule: "You can enter if you are both over 12 and have a ticket." Which condition matches?
A. age > 12 AND hasTicket = TRUE ✓
B. age > 12 OR hasTicket = TRUE
The key word "both" signals AND. Both parts must be true at the same time.
2. Rule: "A student gets a lunch pass if they are in Year 9 or Year 10." Which condition matches?
A. year = 9 OR year = 10 ✓
B. year = 9 AND year = 10
"Either / or" signals OR. One student cannot be in both years at once, so AND would never be true.
3. Rule: "Allow the login unless the password is empty." Which condition matches?
A. NOT (password = "") ✓
B. password = "" AND allowed
"Unless" and "not" signal NOT. The login is allowed when the password is NOT empty.
4. Rule: "The score must be between 50 and 80 (inclusive)." Which condition matches?
A. score >= 50 OR score <= 80
B. score >= 50 AND score <= 80 ✓
"Between" means both limits apply, so use AND. With OR, every number would pass (for example 10 or 200).
5. Rule: "The pool is closed if it is either raining or the temperature is below 15." Which condition matches?
A. raining = TRUE AND temp < 15
B. raining = TRUE OR temp < 15 ✓
"Either / or" signals OR. Just one of the conditions being true is enough to close the pool.

Match the Pairs

age >= 13 AND hasPermission = TRUE → The rule says 'both': a student must be 13 or older and also have permission, so both parts must be true.
day = "Sat" OR day = "Sun" → The rule says 'either': it is a weekend if the day is Saturday or Sunday, so one part being true is enough.
'Unless the bag is empty, pack it' uses the key word 'unless', which signals NOT. → IF NOT (bagEmpty = TRUE) THEN
'Between 10 and 20 inclusive' needs a lower limit AND an upper limit joined together. → IF score >= 10 AND score <= 20 THEN
IF age < 13 OR age > 19 THEN // rule: between 13 and 19 → The rule 'between 13 and 19' means both limits must hold, so it needs AND, not OR. Also the comparisons are reversed, as this tests for outside the range.
IF colour = "red" AND colour = "blue" THEN // rule: either red or blue → 'Either red or blue' signals OR, but AND was used. One variable cannot be both red and blue at once, so the condition is never true.

Key Term

both = AND, either = OR, not = NOT
Key words in a worded rule signal the operator: both/and means AND, either/or means OR, not/unless/except means NOT. Use them to rewrite the rule as a compound condition.

Fill in the Blanks

1. // Rule: both marks are 50 or more IF maths >= 50 AND english >= 50 THEN
Hint: The word both means two conditions must be true. Type the logical operator that joins them.
2. // Rule: either Saturday or Sunday IF day = "Sat" OR day = "Sun" THEN
Hint: The word either means at least one condition is enough. Type the logical operator for that.
3. // Rule: unless it is raining IF NOT raining THEN
Hint: The word unless flips the condition. Type the logical operator that reverses true and false.
4. // Rule: between 10 and 20 inclusive IF age >= 10 AND age <= 20 THEN
Hint: Between needs a lower and an upper limit. Type the relational operator for the upper limit, which includes 20.
5. // Rule: neither red nor blue IF NOT (colour = "red" OR colour = "blue") THEN
Hint: Neither...nor means NOT either one. Type the operator that joins the two colour tests inside the brackets.

Spot the Error

Question 1
A INPUT age, ok
B IF age >= 13 OR ok = 1 THEN
C OUTPUT "Enter"
D ENDIF
Line B — The rule says BOTH the age condition and the pass condition must be true, so the operator must be AND. With OR, someone with a pass but under 13 would get in.
Question 2
A INPUT cost
B INPUT vip
C ship ← 8
D IF cost > 50 AND vip = 1 THEN
E ship ← 0
F ENDIF
Line D — The rule says EITHER an order over $50 OR a VIP gets free shipping. Either/or means OR. With AND, a VIP with a small order would be charged.
Question 3
A INPUT raining
B IF raining = 1 THEN
C OUTPUT "Go outside"
D ENDIF
Line B — The rule says go outside UNLESS it is raining. 'Unless' means NOT, so the condition must be IF NOT (raining = 1) THEN. The broken line does the opposite.
Question 4
A INPUT m, a
B pass ← 0
C IF m < 50 OR a < 50 THEN
D pass ← 1
E ENDIF
Line C — 'Neither maths nor art is below 50' means NOT (either is below 50). The condition needs NOT around the whole bracket: IF NOT (m < 50 OR a < 50) THEN. The broken line passes students who are below 50.
Question 5
A INPUT n
B teen ← 0
C IF n >= 13 OR n <= 19 THEN
D teen ← 1
E ENDIF
Line C — 'Between 13 and 19' means both limits must be true at once, so the two tests are joined with AND. With OR, every number passes.

Student with a class code? Join your class →