GRADE 9 · COMPUTING · UNIT 1 · LESSON 1.3
Computational thinking and programming
Creating algorithms
Read a little. Try the workbook. Check your answers. Choose one section below to get started.
LET’S LOOK, THINK AND TRY
Creating algorithms
- Decompose a task into input, processing and output
- Use nested decisions to solve a multi-condition problem
Turn a specification into connected steps
Separate the inputs, processing rules and required outputs. Sequence gives their order. Selection chooses a path after a condition, and iteration repeats work. In a flowchart, label both exits from a decision diamond, join each path correctly and include a reachable end.
Give a reusable part a clear contract
Decomposition divides a problem into smaller tasks. A named subroutine can perform a reusable task. Specify the inputs it receives and what result or effect it produces, then call it from the main algorithm. Reusing a named routine does not remove the need to test its boundary cases or the complete solution.

Work through an original example
Design an original booking check. A group count must be a whole number from 2 to 12 inclusive. A valid group pays 4 credits per person. Work through counts 1, 2 and 12.
Input the count first. Test both limits and the whole-number requirement. A count of 1 fails and produces an error without a payment. Counts 2 and 12 pass, giving 8 and 48 credits. A reusable payment routine can multiply an already validated count by 4. Keep validation before that call.
Try it before the workbook
Which comparison checks the upper boundary: count < 12 or count <= 12?
Use the example to choose your first step. This short preparation question is separate from your workbook. Open the check clue when you are ready.
Explore the clues
Open one card at a time to review your thinking.
Remember the idea
Separate the inputs, processing rules and required outputs. Sequence gives their order. Selection chooses a path after a condition, and iteration repeats work. In a flowchart, label both exits from a decision diamond, join each path correctly and include a reachable end.
Check your first try
count <= 12
The upper endpoint is included by the specification, so count <= 12 is required alongside the other validation checks.
Explain and check
- Match exact code outputs, binary widths and stated units. Explain your method.
- Check the question, rules, outputs and units. Explain why your method works.

Think it through with Paxa!
Trace the stated rules and distinguish predictions from actual observations.
Original computing practice files
Optional small offline examples and fictional datasets, created for PaxaKids. They are supplementary practice, not publisher downloads or complete implementations of every workbook project. The page does not execute these files. Inspect code with a grown-up before using it in an approved offline environment; do not use real personal data.
Our Unit 1 learning path
- Lesson 1.1: Pseudocode
- Lesson 1.2: Iteration
- Lesson 1.3: Creating algorithms
- Lesson 1.4: Loops in text-based programming
- Lesson 1.5: Programming with data
- Lesson 1.6: Comparing algorithms
- Lesson 1.7: Searching algorithms
- Lesson 1.8: Testing
- Lesson 1.9: Physical computing
- Lesson 1.10: Word guess
- Lesson 1.11: Flowchart - Pseudocode - Program code
- Lesson 1.12: Original Paxa project: Revision challenge app
- Lesson 1.13: Check your progress
- Lesson 1.14: Computational thinking and programming - unit check
For grown-ups: using this lesson
Discuss the idea and worked example, then try the workbook. 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. Accept a sound alternative method.
Opening or checking a worksheet does not complete a lesson. Choose “Mark lesson finished” when ready. Optional account progress saves the selected grade, lesson position and completion across devices. Personal worksheet responses stay in this tab; save your own copy before leaving.
2. Fill in your workbook
Use the original diagrams and stated conventions. Choose, write or draw on the pages, or use the larger Answer List controls. Code examples here are for tracing; this page does not execute them or connect to hardware. Use fictional data and approved supervised tools for project work.
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 18 original A4 student pages, ready for pencil-and-paper practice. Choose Review Answers to check your work on this webpage.
Student worksheet only · PDF · 6.8 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 18 worksheets
Worksheet 1
- Question 1: What should decomposition produce? Smaller tasks with clear responsibilities
Worksheet 2
- Question 2: Which item is an input? The chosen fare category
- Question 3: Which is a processing step? Multiply the selected rate by the group count
Worksheet 3
- Question 4: Which booking qualifies for the group discount? 10 children
- Question 5: Which count is valid at the upper boundary? 30
Worksheet 4
- Question 6: Input adult: rate 12
- Question 7: Input concession: rate 9
- Question 8: Input student: rate -1
Worksheet 5
- Question 9: With rate = -1, what is skipped? The count-range check
- Question 10: With rate = 12 and count = 0, what should happen? Display the count error only
Worksheet 6
- Question 11: Case A: result 36 / 36.00
- Question 12: Case B: result 63 / 63.00
- Question 13: Case C: result 243 / 243.00
- Question 14: Case D: result Category error
- Question 15: Case E: result Count error
Worksheet 7
- Question 16: Why reuse one group-total routine? Keep the calculation in one place for several bookings
Worksheet 8
- Question 17: groupTotal(12, 10) returns 108 / 108.00
- Question 18: groupTotal(7, 3) returns 21 / 21.00
- Question 19: groupTotal(9, 1) returns 9 / 9.00
- Question 20: What does RETURN amount do here? Passes the calculated number back to the caller
Worksheet 9
- Question 21: Which values are arguments in this call? 12 and 10
- Question 22: Where does the returned value go? Into the caller variable payment
Worksheet 10
- Question 23: How many times is groupTotal called? 3
- Question 24: What is the second booking subtotal? 63 / 63.00
- Question 25: What grand total is displayed after the loop? 114 / 114.00
Worksheet 11
- Question 26: Case A: result 12 / 12.00
- Question 27: Case B: result 108 / 108.00
- Question 28: Case C: result 108 / 108.00
- Question 29: Case D: result Count error
- Question 30: Why do 9 and 10 people both pay 108 at rate 12? 10 people receive a discount; 9 do not
Worksheet 12
- Question 31: Which response best handles input category student? Ask the user to choose one of the three allowed categories
- Question 32: What should happen before comparing text input with 30? Check and safely convert a valid whole-number entry
Worksheet 13
- Question 33: What value is displayed by the faulty last line? 27 / 27.00
- Question 34: What should the final displayed total be? 114 / 114.00
- Question 35: Which last line meets the specification? OUTPUT grand
Worksheet 14
- Question 36: What text should be displayed? 12.50
- Question 37: What must be known before reusing a routine? Its inputs, result and preconditions
- Question 38: What can the paper contract establish? The expected result under its stated assumptions
Worksheet 15
- Question 39: Which discount condition meets the specification? count >= 10
- Question 40: Which invalid-count test exposes the range fault? Count 0 must give a count error
- Question 41: What should replace Payment: -1 for an invalid category? A message listing adult, child and concession
Worksheet 16
- Question 42: Which statement is justified before implementation? These are expected outcomes from the stated rules
- Question 43: What should follow a correction to the discount condition? Retest at 9, 10 and 11 with expected results
Worksheet 17
- Question 44: Write a groupTotal function with parameters and a returned result. Then write a three-iteration main loop that calls it, displays each subtotal and displays the accumulated grand total. Add a compact trace. Function receives rate and count, computes amount = rate * count, multiplies by 0.90 if count >= 10, then returns amount. Caller initialises grand once to zero, loops exactly three times, reads the next pair, calls groupTotal(rate, count), stores and displays the result, and adds it to grand; displays grand after the loop. Subtotals are 24, 63 and 27; accumulated grand values are 24, 87 and 114; final grand is 114. Check distinction between definition and invocation, parameters and arguments, return and output, inclusive bounds and accumulator placement. Accept equivalent correct explicit pseudocode and a well-labelled trace. Grown-up review; discuss your evidence and reasoning.
Worksheet 18
- Question 45: Trace adult with count 3 and concession with count 10. Explain the different IF / ELSEIF paths and payments. Improve the response for an unknown category and for count 31. Add tests at counts 9 and 10, and explain one limitation of these tests. For adult, the first category branch selects rate 12, later category branches are skipped, count 3 is valid and no discount applies: payment 36. For concession, adult and child are false, concession is true and rate is 9; count 10 qualifies, giving payment 81. Unknown category must give an actionable category message and no payment. Count 31 must give an allowed-range message and no payment. At rate 12, count 9 gives 108 without discount, while count 10 gives 108 after discount; the path and intermediate subtotal distinguish them. Accept another specified category with correct boundary results. The tests support sampled requirements but cannot prove every input or an unseen implementation correct. Actual test claims require actual observed evidence or Pending. Accept equivalent explanations and clear tables. Grown-up review; discuss your evidence and reasoning.
Curriculum & workbook reference
- Cambridge Lower Secondary Computing Learner’s Book 9 — pages 46–49, 78–79
Computing for your homeschool day
Explore Creating algorithms with this free Grade 9 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.
The original practice follows the source topic teaching.
The page references identify the reviewed actual supplied book teaching and related practice. Only the cited Learner’s Book teaching pages are listed here. No matching publisher Workbook 9 was supplied or cited. The original PaxaKids workbook is the student download; no textbook scan is published. Explanations, worked models and student workbooks here are original PaxaKids companion material.
The source topic number is preserved.
