GRADE 8 · COMPUTING · UNIT 1 · LESSON 1.7
Computational thinking and programming
Conditions and two-way flow
Read a little. Try the workbook. Check your answers. Choose one section below to get started.
LET’S TRACE, REASON AND TEST
Conditions and two-way flow
A condition has a Boolean result: true or false. In a two-way decision, one branch is chosen according to that result. State the comparison and test a value on each side of its boundary.
- Read a decision diamond and evaluate a comparison before following its true or false branch.
- Explain my method and support it with a labelled trace, example or test record.

Work through an example
For a fictional rule that a score of at least 12 earns a badge, score >= 12 is true at 12 and false at 11. The equality case matters because at least includes the boundary.
Try before your workbook
For a rule count > 5, should a count of exactly 5 follow the true branch?
Explore the clues
Tap one card to find out more.
Understand the idea
A condition has a Boolean result: true or false. In a two-way decision, one branch is chosen according to that result. State the comparison and test a value on each side of its boundary.
Concept to practise: Conditions and two-way flow.
Work through an example
For a fictional rule that a score of at least 12 earns a badge, score >= 12 is true at 12 and false at 11. The equality case matters because at least includes the boundary.
Try before your workbook
For a rule count > 5, should a count of exactly 5 follow the true branch?
Check my readiness thinking
No. Greater than excludes equality. A count of 6 follows the true branch; 5 follows the false branch.
Your original programs and learning models
These original PaxaKids program and data models support your workbook. Some examples deliberately contain faults to investigate. Follow their headings and preserve exact code case, punctuation and order. Traces and supplied records are not claims of physical testing.
Choose a route by evaluating a condition
Our examples use whole-number fictional prices and counts. In this workbook, == means equal, != means not equal, and <- means assignment. These are stated pseudocode conventions; Python uses = for assignment.
Follow both routes of this original budget plan

Read this model’s labels and values
- Before
- start
- Start
- input
- INPUT cost
- Condition
- cost < 30
- True
- output
- OUTPUT
"Buy option"
- False
- output
- OUTPUT "Wait"
- process
- extra <-
cost - 30
- output
- OUTPUT extra
Test below, at and above the boundary
| Input cost | Condition cost < 30 | Route and exact output |
|---|---|---|
| 29 | {'clue': 'True or False', 'prompt': 'For cost 29: cost < 30', 'answers': ['True', 'true']} | Complete the question below. |
| 30 | {'clue': 'True or False', 'prompt': 'For cost 30: cost < 30', 'answers': ['False', 'false']} | Complete the questions below. |
| 31 | {'clue': 'True or False', 'prompt': 'For cost 31: cost < 30', 'answers': ['False', 'false']} | Complete the question below. |
Use all six comparison operators
| Operator | Meaning | Example and result |
|---|---|---|
| == | equal to | 8 == 8 is True |
| != | not equal to | 8 != 8 is False |
| less than | 8 < 9 is True | |
| > | greater than | 8 > 9 is False |
| <= | less than or equal to | 8 <= 8 is True |
| >= | greater than or equal to | 8 >= 8 is True |
A condition can compare exact strings
The illustration sets the scene. Use the stated text rules, not anything printed on its props.
Read the source boundary before repairing it
A simple IF can also omit an ELSE: False then skips the inside action and continues after ENDIF. Do not invent a False action that is absent.
ORIGINAL ONE-ACTION EXAMPLE
INPUT tokens
IF tokens > 0 THEN
OUTPUT "Token available"
ENDIF
OUTPUT "Finished"Files for this activity
Use these original PaxaKids practice files with the matching workbook. Work on a local copy in the appropriate editor. Some examples deliberately contain faults to investigate; a downloaded file is not a completed practical test.

Try one step with Paxa!
Trace code in the stated order and preserve exact spelling and case. Use fictional data. Label a prediction, paper trace, simulator run and physical-device test separately; an unperformed test stays Pending. Save personal responses before leaving.
Our Unit 1 learning path
- Lesson 1.1: Recall algorithms and representations
- Lesson 1.2: Purpose and conventions of pseudocode
- Lesson 1.3: Input, output and strings
- Lesson 1.4: Identifiers and assignment
- Lesson 1.5: Arithmetic and translation
- Lesson 1.6: Trace and review a sequence
- Lesson 1.7: Conditions and two-way flow
- Lesson 1.8: IF THEN and indentation
- Lesson 1.9: IF THEN ELSE and decision diagrams
- Lesson 1.10: Ordered ELSEIF and fallback ELSE
- Lesson 1.11: Match flowchart and pseudocode branches
- Lesson 1.12: AND, OR and NOT
- Lesson 1.13: Grouping, precedence and review
- Lesson 1.14: Why software searches
- Lesson 1.15: A successful linear search
- Lesson 1.16: An unsuccessful search and termination
- Lesson 1.17: Practise and communicate the search
- Lesson 1.18: Translate conditions into Python
- Lesson 1.19: One-branch IF programs
- Lesson 1.20: Two-way IF ELSE programs
- Lesson 1.21: Ordered ELIF choices
- Lesson 1.22: Ranges and independent decisions
- Lesson 1.23: Boolean operators in Python
- Lesson 1.24: Design and test recommendations
- Lesson 1.25: Trace, debug and reflect
- Lesson 1.26: Choose data types and recognise Boolean literals
- Lesson 1.27: Set and use Boolean flags
- Lesson 1.28: Explain and identify constants
- Lesson 1.29: Express constants in three algorithm forms
- Lesson 1.30: Use a fixed factor in a calculation
- Lesson 1.31: Cast to Boolean and validate an empty response
- Lesson 1.32: Recall calls and trace return values
- Lesson 1.33: Supply parameters and reuse library code
- Lesson 1.34: Choose and import libraries responsibly
- Lesson 1.35: Round with floor and ceiling
- Lesson 1.36: Use pi and investigate another mathematical feature
- Lesson 1.37: Generate random choices within bounds
- Lesson 1.38: Investigate random real values and review library use
- Lesson 1.39: Retrieve test tables and predict selection outcomes
- Lesson 1.40: Decompose everyday problems
- Lesson 1.41: Decompose programs and organise shared work
- Lesson 1.42: Develop through repeated build/test cycles
- Lesson 1.43: Predict and verify algorithm outcomes
- Lesson 1.44: Choose representative and boundary tests
- Lesson 1.45: Build, execute and review a test plan
- Lesson 1.46: Recall physical inputs and compare transmission media
- Lesson 1.47: Configure a radio group and agree a message scheme
- Lesson 1.48: Send and receive numbers and strings
- Lesson 1.49: Trace numeric message sequences
- Lesson 1.50: Transmit text and use received data in conditions
- Lesson 1.51: Diagnose and extend a message protocol
- Lesson 1.52: Review communication and evidence of testing
- Lesson 1.53: Project 1: Adventure story
- Lesson 1.54: Project 2: Fire, Water, Earth
- Lesson 1.55: Check your progress 1
For grown-ups: using this lesson
Your answers are checked in your browser. Open responses need grown-up review and are shown separately from the automatic score. Check your work, then use “Retry answers to practise” to revisit mistakes while keeping correct responses.
Read one explanation, discuss the model and try the readiness check before the workbook. Choose “Mark lesson finished” when ready. Optional account progress saves lesson position and completion across devices; save personal responses before leaving.
2. Fill in your workbook
Read the teaching and complete workbook instructions. Choose, write or draw; Answer list offers larger controls. Trace code precisely and distinguish predictions from actual tests. Review designs, explanations and drawings with a grown-up.
Opening your PDF…
Swipe sideways across the worksheet on a small screen, or use “Answer list” for larger controls.
You’ve completed the checked activities.
TAKE YOUR PRACTICE OFFLINE
3. Download the student worksheet
All 8 original A4 student pages, ready for pencil-and-paper practice. Choose Review Answers to check your work on this webpage.
Student worksheet only · PDF · 8.3 MiB · No answer key included
TRY FIRST, THEN CHECK TOGETHER
Download the student worksheet →4. Answers & guidance
Finished your try? Open the guide and compare one worksheet at a time. Your own words may be different and still explain the right idea.
Shown on this webpage only. There is no answer-key download, and this guide is left out when printing the page.
Show answers for all 8 worksheets
Worksheet 1
- Question 1: What determines the exit from a decision diamond? the truth value of its condition
- Question 2: For cost = 18, what is the result of cost < 30? True
- Question 3: Which shape normally contains an assignment calculation? a process rectangle
Worksheet 2
This page introduces the activity. There are no marked responses on this sheet.
Worksheet 3
- Question 4: For cost 29: cost < 30 True / true
- Question 5: For cost 30: cost < 30 False / false
- Question 6: For cost 31: cost < 30 False / false
- Question 7: Which output is displayed for cost 29? Buy option
- Question 8: After Wait, which number is displayed for cost 30? 0
- Question 9: After Wait, which number is displayed for cost 31? 1
Worksheet 4
- Question 10: Which comparison is True when count equals 5? count >= 5
- Question 11: Which condition excludes exactly the value 5? count != 5
Worksheet 5
- Question 12: For seat = "Balcony", which route is followed? True: Upper room
- Question 13: For seat = "balcony", which output is produced? Main room
- Question 14: Which operator tests equality under our convention? ==
Worksheet 6
- Question 15: In the source budget example, write True or False for 22 < 22. False / false
- Question 16: In that same source example, what is extra when cost is 22? 0
- Question 17: For tokens = 0, what does the one-action example display? Finished only
Worksheet 7
- Question 18: Design an original theatre decision flowchart. Input whole-number tickets_left. If tickets_left > 0, output "Tickets available"; otherwise output "Sold out". Use the correct input, decision, output and start/stop shapes. Label both decision exits, join both routes to Stop, then record the route and exact output for inputs 0, 1 and 4. Use only the stated inputs; do not add real booking details. Require Start, INPUT tickets_left in parallelogram, tickets_left > 0 diamond, True to Tickets available and False to Sold out in output parallelograms; both reach Stop. 0 False/Sold out; 1 and 4 True/Tickets available. No assignment masquerading as input/output. Arrow direction unambiguous, labels readable and no disconnected branch. Equivalent clean layout accepted. No numeric scoring. Grown-up review; personal evidence is required.
Worksheet 8
- Question 19: Compare two book-fair policies: A accepts cost < 30; B accepts cost <= 30. For costs 29, 30 and 31, record each truth value and state which inputs change route. Explain why the page 2 plan displays Wait then 0 at cost 30. Propose the single comparison change for an inclusive 30-unit budget. Explain the similar cost-22 issue in the source example. Identify whether your evidence is a manual trace or an actual program run, and record any practical or peer step still Pending. A results True, False, False; B True, True, False. Only cost 30 changes route. Page 2 as written follows False at 30, outputs Wait, computes extra = 0 and outputs 0. Change < to <= for an inclusive limit; trace original first, clearly label revised requirement. Source 22 < 22 is False, extra 0, analogous <= repair for inclusive 22. Require exact route/output evidence and honest trace/run distinction; optional ELSE is not universally mandatory. No invented completion or numeric marks. Grown-up review; personal evidence is required.
Curriculum & workbook reference
- Cambridge Lower Secondary Computing Learner’s Book 8 — pages 27–30
- PaxaKids Grade 8 Computing Lesson 1.7: Conditions and two-way flow — pages 1–8
Computing for your homeschool day
Explore Conditions and two-way flow with this free Grade 8 Computing lesson. Read one idea together, try the fillable workbook and return to review at your own pace. Download the same student worksheet PDF for pencil-and-paper practice.
Fit learning around your family’s day. There is no timer and no sign-up is needed to use the lesson. An optional account saves your lesson position and completion across devices. Workbook responses and drawings stay in this tab; save a copy of your responses before leaving.
Understand your results
Closed answers are checked in your browser. Drawings and written explanations need grown-up review and are shown separately from the automatic score. Check your work, then use “Retry answers to practise” to revisit mistakes while keeping correct responses.
Choose Review Answers after trying the activity. The guide stays on the webpage; the worksheet download contains only the student pages.
For programme background, visit the Cambridge Lower Secondary Computing overview. PaxaKids provides independent original companion practice.
Book page references identify the related teaching topic. File-management and responsible-data preparation are original PaxaKids material; orientation or contents pages are not presented as teaching citations for those skills. The explanations, characters, programs and exercises here are original PaxaKids companion practice. Practical tasks require the appropriate editor and, where applicable, suitable equipment. A design or paper trace is not a verified hardware result. Only completed, reviewed lessons are listed.
Explore the Cambridge Lower Secondary Computing curriculum for programme background. PaxaKids is an independent learning resource.
