GRADE 8 · COMPUTING · UNIT 1 · LESSON 1.9
Computational thinking and programming
IF THEN ELSE and decision diagrams
Read a little. Try the workbook. Check your answers. Choose one section below to get started.
LET’S TRACE, REASON AND TEST
IF THEN ELSE and decision diagrams
IF and ELSE select between two alternatives. Follow the labelled true and false arrows in a decision diagram, then rejoin the common path. Do not execute both alternatives for one decision.
- Follow both alternatives and develop a recommendation diagram whose paths reach defined outcomes.
- Explain my method and support it with a labelled trace, example or test record.

Work through an example
For IF count >= 10 THEN OUTPUT "Large" ELSE OUTPUT "Small", count 8 produces Small. The two labels belong to alternative branches, not consecutive outputs.
Try before your workbook
What should count 10 produce under that rule, and why?
Explore the clues
Tap one card to find out more.
Understand the idea
IF and ELSE select between two alternatives. Follow the labelled true and false arrows in a decision diagram, then rejoin the common path. Do not execute both alternatives for one decision.
Concept to practise: IF THEN ELSE and decision diagrams.
Work through an example
For IF count >= 10 THEN OUTPUT "Large" ELSE OUTPUT "Small", count 8 produces Small. The two labels belong to alternative branches, not consecutive outputs.
Try before your workbook
What should count 10 produce under that rule, and why?
Check my readiness thinking
It produces Large because >= includes 10. The ELSE branch is skipped for this decision.
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.
Give both truth values an intentional outcome
A robot-project checklist supplies fictional counts for practising a percentage decision. These numbers describe task data, not marks for your workbook.
Investigate an original count-to-percentage plan
ORIGINAL PROJECT PROGRESS PLAN
INPUT completed
percentage <- (completed / 40) * 100
IF percentage > 60 THEN
OUTPUT "Ready for review"
ELSE
OUTPUT "Continue building"
ENDIFCalculate first, then compare
| Completed out of 40 | Percentage | percentage > 60 |
|---|---|---|
| 0 | {'clue': 'Percentage', 'prompt': 'Completed 0: percentage', 'answers': ['0', '0.0']} | {'clue': 'True or False', 'prompt': 'Completed 0: percentage > 60', 'answers': ['False', 'false']} |
| 23 | {'clue': 'Percentage', 'prompt': 'Completed 23: percentage', 'answers': ['57.5']} | {'clue': 'True or False', 'prompt': 'Completed 23: percentage > 60', 'answers': ['False', 'false']} |
| 24 | {'clue': 'Percentage', 'prompt': 'Completed 24: percentage', 'answers': ['60', '60.0']} | {'clue': 'True or False', 'prompt': 'Completed 24: percentage > 60', 'answers': ['False', 'false']} |
| 25 | {'clue': 'Percentage', 'prompt': 'Completed 25: percentage', 'answers': ['62.5']} | {'clue': 'True or False', 'prompt': 'Completed 25: percentage > 60', 'answers': ['True', 'true']} |
| 40 | {'clue': 'Percentage', 'prompt': 'Completed 40: percentage', 'answers': ['100', '100.0']} | {'clue': 'True or False', 'prompt': 'Completed 40: percentage > 60', 'answers': ['True', 'true']} |
Plan a two-option recommendation quiz
Our original club quiz starts with Prefer making? A True answer asks Stay indoors? A False answer asks Enjoy acting? Each later answer reaches one of four recommendations.
| First answer | Next question | True / False outcomes |
|---|---|---|
| True | Stay indoors? | Model club / Outdoor build |
| False | Enjoy acting? | Drama club / Book club |
Read the complete original club diagram

Read this model’s labels and values
- Root
- Prefer making?
- Questions
- Stay indoors?
- Enjoy acting?
- Outcomes
- Model
club - Outdoor
build - Drama
club - Book
club
- Model
Check coverage, boundaries and practical evidence
| Input or route | Expected result |
|---|---|
| completed = 23 | 57.5%; Continue building |
| completed = 24 | 60%; Continue building |
| completed = 25 | 62.5%; Ready for review |
| Making True, indoors True | Model club |
| Making False, acting False | Book club |
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.5 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: When does ELSE run in a simple IF THEN ELSE? when the IF condition is False
- Question 2: What is needed to test both alternatives? at least one input making each truth value occur
Worksheet 2
- Question 3: What is the condition that selects the message? percentage > 60
- Question 4: Which message belongs to the False alternative? Continue building
- Question 5: At completed = 24, what percentage is calculated? 60 / 60.0
Worksheet 3
- Question 6: Completed 0: percentage 0 / 0.0
- Question 7: Completed 0: percentage > 60 False / false
- Question 8: Completed 23: percentage 57.5
- Question 9: Completed 23: percentage > 60 False / false
- Question 10: Completed 24: percentage 60 / 60.0
- Question 11: Completed 24: percentage > 60 False / false
- Question 12: Completed 25: percentage 62.5
- Question 13: Completed 25: percentage > 60 True / true
- Question 14: Completed 40: percentage 100 / 100.0
- Question 15: Completed 40: percentage > 60 True / true
Worksheet 4
- Question 16: Which design leaves an incomplete route? a False exit with no next question or recommendation
Worksheet 5
- Question 17: Prefer making is False; Enjoy acting is True. What is recommended? Drama club
- Question 18: Prefer making is True; Stay indoors is False. What is recommended? Outdoor build
Worksheet 6
- Question 19: What happens at exactly 40% in the book’s strict percentage > 40 example? the False alternative is selected
- Question 20: Which evidence can honestly be recorded if no partner is available? a manual route test and partner exchange Pending
Worksheet 7
- Question 21: Design your own recommendation quiz on paper or in the space below. Use at least three two-option questions and four named recommendations. Label every answer route so it leads to another question or a recommendation, with no dangling route or endless cycle. Trace a test path to every recommendation and record the answers and result. If working with others, divide roles, exchange a test and cite one actual collaboration contribution; if working alone, record partner testing as Pending. Accept original readable two-option tree with at least three question nodes and four defined recommendation outcomes. Every answer leads to another question or recommendation; no dangling paths, unintended loops or ambiguous labels. Test cases cover every leaf and agree with routing; list answers in reached-question order, not invented answers to skipped questions. For actual group work require concrete role/contribution and exchange evidence; otherwise honest individual method and Pending partner exchange. No numeric self/peer rating. Grown-up review; personal evidence is required.
Worksheet 8
- Question 22: Use the page 2 project plan. Identify its True and False actions, then choose one input for each output and include completed = 24 as a boundary test. Show each percentage, selected branch and exact message. Check by trace or actual run. Compare the strict > 60 rule with a new >= 60 policy and identify which boundary result changes. Then explain how your page 7 diagram could be automated: how answers are stored and how the next question is chosen. Record one evidenced strength and one next step for your own or actual group work; leave unperformed collaboration Pending. True message Ready for review, False Continue building. Any valid inputs 25–40 for True and 0–24 for False; 24 -> 60 -> False -> Continue building. Typical 23 -> 57.5 False, 25 -> 62.5 True. Revised >= changes completed 24 to True; original trace preserved. Automation must input/store responses, evaluate a condition, follow the appropriate next-question or output route, and terminate at recommendation. Reflection uses concrete work evidence, nonnumeric judgement and next action, with no fabricated peer or device work. Grown-up review; personal evidence is required.
Curriculum & workbook reference
- Cambridge Lower Secondary Computing Learner’s Book 8 — pages 33–37
- PaxaKids Grade 8 Computing Lesson 1.9: IF THEN ELSE and decision diagrams — pages 1–8
Computing for your homeschool day
Explore IF THEN ELSE and decision diagrams 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.
