← ACARA Digital Technologies Years 9–10

Tracing a compound condition step by step

Work out each part as TRUE or FALSE for the current values, record both in the trace table, then combine them with AND, OR or NOT. Do brackets first.

Understanding Tracing a compound condition step by step in ACARA Digital Technologies Years 9–10

What it does: The columns show each part's result separately (count < 5 and lives > 0), then a final column for the combined result. The bracket (a > 2 AND b < 4) is traced first to get TRUE or FALSE, and only then does NOT reverse that result. OR is TRUE when at least one part is TRUE. hasTicket = TRUE is TRUE, so the whole condition is TRUE.

Common mistakes: 65 is greater than or equal to 50, so part A is TRUE, not FALSE. Each part must be worked out correctly before combining. The trace says NOT raining is TRUE, so raining must be FALSE. The values on line 1 should be temp=30, raining=FALSE.

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
score = 8 and lives = 0. What is the result of: score > 5 AND lives > 0?
TRUE AND FALSE → TRUETRUE AND FALSE → FALSE
Matches
WHILE n < 10 AND found = FALSE Trace: only one column for the whole condition
↓
The trace table records only the final result, so you cannot tell which part made the loop stop. Add a column for n < 10 and a column for found = FALSE.
Applying
Meanings
Term
trace a compound condition
Meaning
Work out each part as TRUE or FALSE for the current values, record both in the trace table, then combine them with AND, OR or NOT. Do brackets first.
Practice
lives ← 5
Testing
Gaps
TRUE AND FALSE is
Check Answer
Spots
1score ← 65
2// A: score >= 50 is FALSE

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

The 'Dolphin' badge — Reef Streak, 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. score = 8 and lives = 0. What is the result of: score > 5 AND lives > 0?
A. TRUE AND FALSE → TRUE
B. TRUE AND FALSE → FALSE ✓
score > 5 is TRUE but lives > 0 is FALSE. AND is only TRUE when both parts are TRUE, so the whole condition is FALSE.
2. age = 12 and hasTicket = TRUE. What is the result of: age >= 16 OR hasTicket = TRUE?
A. FALSE OR TRUE → TRUE ✓
B. FALSE OR TRUE → FALSE
OR is TRUE when at least one part is TRUE. hasTicket = TRUE is TRUE, so the whole condition is TRUE.
3. You are tracing WHILE x < 10 AND y <> 0. How should you set up the trace table?
A. Add a column for x < 10, a column for y <> 0, and a column for the whole condition ✓
B. Only record the final TRUE or FALSE for the whole condition
Extra columns for each part let you see exactly how the result was worked out, so mistakes are easier to spot.
4. a = 5 and b = 1. How do you trace: NOT (a > 3 OR b > 3)?
A. Apply NOT to a > 3 first, then combine the answer with b > 3 using OR
B. Work out a > 3 OR b > 3 inside the brackets first (TRUE), then apply NOT → FALSE ✓
Brackets are always worked out first. The NOT applies to the result of the whole bracket, not to just one part.
5. a = 2, b = 9, c = 1. What is the result of: (a > 5 OR b > 5) AND c > 5?
A. (FALSE OR TRUE) AND FALSE → TRUE AND FALSE → FALSE ✓
B. (FALSE OR TRUE) AND FALSE → TRUE OR FALSE → TRUE
Do the brackets first: FALSE OR TRUE is TRUE. Then TRUE AND FALSE is FALSE. The AND does not change into an OR.

Match the Pairs

(age >= 13) AND (score > 50) → Work out each bracketed part as TRUE or FALSE first, then combine the two results with AND. Both parts must be TRUE for the whole condition to be TRUE.
x < 3 OR done = TRUE → Check each part separately and record TRUE or FALSE in its own trace table column, then combine with OR. Only one part needs to be TRUE for the whole condition to be TRUE.
Add an extra trace table column for each part of the condition so both TRUE/FALSE results are recorded before combining → | count | count < 5 | lives > 0 | both |
Brackets are worked out first, then the NOT or the AND/OR that uses their results → NOT (a > 2 AND b < 4)
WHILE n < 10 AND found = FALSE Trace: only one column for the whole condition → The trace table records only the final result, so you cannot tell which part made the loop stop. Add a column for n < 10 and a column for found = FALSE.
NOT (x > 5 AND y > 5) with x = 8, y = 2: NOT x > 5 = FALSE, so the answer is FALSE → The brackets were not worked out first. The bracket (8 > 5 AND 2 > 5) is TRUE AND FALSE = FALSE, so NOT FALSE = TRUE.

Key Term

trace a compound condition
Work out each part as TRUE or FALSE for the current values, record both in the trace table, then combine them with AND, OR or NOT. Do brackets first.

Fill in the Blanks

1. WHILE score < 50 AND lives > 0 DO score < 50 is TRUE, lives > 0 is FALSE TRUE AND FALSE is FALSE
Hint: Type the final value when both recorded parts are combined with the operator that needs every part to be true.
2. temp ← 35, rain ← 0 temp > 30 is TRUE, rain > 5 is FALSE TRUE OR FALSE is TRUE
Hint: Type the logical operator that gives a true result when only one of the two recorded parts is true.
3. a ← 5, b ← 1, c ← 0 (a > 3 OR b > 3) AND c > 3 (TRUE OR FALSE) AND FALSE: TRUE AND FALSE
Hint: Brackets are worked out first. Type the value the bracketed part becomes.
4. UNTIL found = TRUE OR tries = 3 found = TRUE is FALSE, tries = 3 is TRUE Loop stopped because tries = 3 was TRUE
Hint: Type the variable name from the part of the condition that made the loop stop.
5. IF NOT (n > 5) AND n > 2 THEN n ← 4: n > 5 is FALSE, NOT FALSE is TRUE n > 2 is TRUE, so the whole condition is TRUE
Hint: Type the logical operator that flips a FALSE value into TRUE.

Spot the Error

Question 1
A score ← 65
B // A: score >= 50 is FALSE
C // B: score < 60 is FALSE
D // A AND B is FALSE
Line B — 65 is greater than or equal to 50, so part A is TRUE, not FALSE. Each part must be worked out correctly before combining.
Question 2
A // temp=30, raining=TRUE
B // A: temp > 25 is TRUE
C // B: NOT raining is TRUE
D // A AND B is TRUE
Line A — The trace says NOT raining is TRUE, so raining must be FALSE. The values on line 1 should be temp=30, raining=FALSE.
Question 3
A // A is TRUE, B is FALSE
B // A OR B is TRUE
C // A AND B is TRUE
Line C — AND is only TRUE when both parts are TRUE. B is FALSE, so A AND B is FALSE.
Question 4
A // A=FALSE, B=FALSE, C=TRUE
B // (A OR B) is TRUE
C // (A OR B) AND C is TRUE
Line A — If A and B were both FALSE, (A OR B) would be FALSE. The values should be A=TRUE, B=FALSE, C=TRUE to match the rest of the trace.
Question 5
A // A=FALSE B=TRUE C=FALSE
B // (B AND C) is TRUE
C // A OR (B AND C) is FALSE
Line B — B is TRUE but C is FALSE, so (B AND C) is FALSE. Brackets are worked out first, so this must be correct.

Student with a class code? Join your class →