GRADE 8 · COMPUTING · UNIT 1 · LESSON 1.41

Computational thinking and programming

Decompose programs and organise shared work

Read a little. Try the workbook. Check your answers. Choose one section below to get started.

Topic 1.41 · Decompose programs and organise shared work9 fillable worksheet pagesRead at your own pace

LET’S TRACE, REASON AND TEST

Decompose programs and organise shared work

When combining routines, agree the names, data types, parameter order and returned results at their boundaries. Clear interfaces help separately developed parts work together. Test the connections as well as each part.

Today’s two goals
  • Compare alternative game decompositions and explain reuse, specialisation and interface agreements.
  • Explain my method and support it with a labelled trace, example or test record.
Original PaxaKids illustration for Decompose programs and organise shared work. Use the supplied program and data models for precise workbook facts.
An original PaxaKids workbook scene. Use the supplied programs and data for precise workbook facts.

Work through an example

If one routine returns an integer score but the next expects text, their interface needs a deliberate conversion or redesign. Matching routine names alone does not make the data compatible.

Try before your workbook

Why should a team agree whether a routine returns a number or displays it directly?

Explore the clues

Tap one card to find out more.

Understand the idea

When combining routines, agree the names, data types, parameter order and returned results at their boundaries. Clear interfaces help separately developed parts work together. Test the connections as well as each part.

Concept to practise: Decompose programs and organise shared work.

Work through an example

If one routine returns an integer score but the next expects text, their interface needs a deliberate conversion or redesign. Matching routine names alone does not make the data compatible.

Try before your workbook

Why should a team agree whether a routine returns a number or displays it directly?

Check my readiness thinking

The caller must know how to use the result. A displayed message is not automatically a returned numeric value that another routine can calculate with.

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.

Organise a program around clear responsibilities

A computer game combines several jobs: prepare data, accept a turn, update the game state, display it and decide when to stop. Decomposition helps us reason about these jobs and develop them in manageable parts.

Different groupings can work. What matters is that the responsibilities cover the whole problem, fit together and have clear inputs and results. The same useful routine may serve several players or another program.

Use complete original board-game rules

This original mini snakes-and-ladders model has two players, both starting at 0. They alternate turns using die values 1–6. Add the die value; an overshoot above 25 leaves the token unchanged. Otherwise apply one shown link if present. Reaching 25 wins and ends play; otherwise pass the turn. There are no extra turns for a six.
Use complete original board-game rules — original labelled workbook model. The following text version gives its labels and values.
Use complete original board-game rules · original PaxaKids model.
Read this model’s labels and values

Compare two valid decompositions

Both plans cover the page 2 rules. In A, advancing a token and applying links are separate responsibilities. In B they are grouped into Update token position. Conversely B gives board display and die production their own responsibilities. Each broad part can contain several steps.
Compare two valid decompositions — original model
A: responsibility groupingB: another valid grouping
Prepare the matchChoose players and initialise their positions
Manage the player’s turnDisplay the board and current player
Advance the tokenProduce the die value
Apply a snake or ladder linkUpdate token position, including links
Decide finish and handoverCheck for a winner; otherwise pass the turn

Agree a reusable movement interface

An interface agreement states what information a part receives and returns. Here position is an integer 0–24 and die an integer 1–6. Apply the page 2 rules and return integer new_position. The caller stores it for the active player; the other player’s position is unchanged.
Original input, process and output model
StageAction
Inputsposition and die: integers
Movement ruleAdvance, reject overshoot, apply one link
Returnnew_position: integer

Trace the agreed movement result

Use the page 2 rules and page 4 contract. First add the die, then reject an overshoot or apply one link. Return the resulting integer. Reaching 14 normally is different from landing on ladder entry 4, even though the final position can match.
Trace the agreed movement result — original model
PositionDieReturned new_position
13{'clue': 'Integer', 'prompt': 'Move from 1 with die 3', 'answers': ['14']}
104{'clue': 'Integer', 'prompt': 'Move from 10 with die 4', 'answers': ['14']}
184{'clue': 'Integer', 'prompt': 'Move from 18 with die 4', 'answers': ['11']}
232{'clue': 'Integer', 'prompt': 'Move from 23 with die 2', 'answers': ['25']}
233{'clue': 'Integer', 'prompt': 'Move from 23 with die 3', 'answers': ['23']}

Share work while using specialist strengths

Developers can work on different responsibilities when they agree inputs, outputs, names and rules first. They then combine the parts and test the whole program. Assigning work alone does not guarantee that the parts will connect correctly.
Share work while using specialist strengths — original model
Specialist in this teamAgreed responsibility
Visual designerCreate the readable board and token artwork.
Rules developerImplement movement, links and exact-finish logic.
Interface developerPresent controls and show the returned position.

Explain the benefits and the limits

Decomposition can make a large problem easier to understand, allow suitable tasks to be shared and expose repeated work that can become reusable routines. Some specialists can focus on their strengths while others develop different parts.

The team still needs communication, consistent rules, clear interfaces and integration tests. Work may proceed at the same time where dependencies allow; it is not automatically faster or error-free.

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.

Paxa the Fox

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
  1. Lesson 1.1: Recall algorithms and representations
  2. Lesson 1.2: Purpose and conventions of pseudocode
  3. Lesson 1.3: Input, output and strings
  4. Lesson 1.4: Identifiers and assignment
  5. Lesson 1.5: Arithmetic and translation
  6. Lesson 1.6: Trace and review a sequence
  7. Lesson 1.7: Conditions and two-way flow
  8. Lesson 1.8: IF THEN and indentation
  9. Lesson 1.9: IF THEN ELSE and decision diagrams
  10. Lesson 1.10: Ordered ELSEIF and fallback ELSE
  11. Lesson 1.11: Match flowchart and pseudocode branches
  12. Lesson 1.12: AND, OR and NOT
  13. Lesson 1.13: Grouping, precedence and review
  14. Lesson 1.14: Why software searches
  15. Lesson 1.15: A successful linear search
  16. Lesson 1.16: An unsuccessful search and termination
  17. Lesson 1.17: Practise and communicate the search
  18. Lesson 1.18: Translate conditions into Python
  19. Lesson 1.19: One-branch IF programs
  20. Lesson 1.20: Two-way IF ELSE programs
  21. Lesson 1.21: Ordered ELIF choices
  22. Lesson 1.22: Ranges and independent decisions
  23. Lesson 1.23: Boolean operators in Python
  24. Lesson 1.24: Design and test recommendations
  25. Lesson 1.25: Trace, debug and reflect
  26. Lesson 1.26: Choose data types and recognise Boolean literals
  27. Lesson 1.27: Set and use Boolean flags
  28. Lesson 1.28: Explain and identify constants
  29. Lesson 1.29: Express constants in three algorithm forms
  30. Lesson 1.30: Use a fixed factor in a calculation
  31. Lesson 1.31: Cast to Boolean and validate an empty response
  32. Lesson 1.32: Recall calls and trace return values
  33. Lesson 1.33: Supply parameters and reuse library code
  34. Lesson 1.34: Choose and import libraries responsibly
  35. Lesson 1.35: Round with floor and ceiling
  36. Lesson 1.36: Use pi and investigate another mathematical feature
  37. Lesson 1.37: Generate random choices within bounds
  38. Lesson 1.38: Investigate random real values and review library use
  39. Lesson 1.39: Retrieve test tables and predict selection outcomes
  40. Lesson 1.40: Decompose everyday problems
  41. Lesson 1.41: Decompose programs and organise shared work
  42. Lesson 1.42: Develop through repeated build/test cycles
  43. Lesson 1.43: Predict and verify algorithm outcomes
  44. Lesson 1.44: Choose representative and boundary tests
  45. Lesson 1.45: Build, execute and review a test plan
  46. Lesson 1.46: Recall physical inputs and compare transmission media
  47. Lesson 1.47: Configure a radio group and agree a message scheme
  48. Lesson 1.48: Send and receive numbers and strings
  49. Lesson 1.49: Trace numeric message sequences
  50. Lesson 1.50: Transmit text and use received data in conditions
  51. Lesson 1.51: Diagnose and extend a message protocol
  52. Lesson 1.52: Review communication and evidence of testing
  53. Lesson 1.53: Project 1: Adventure story
  54. Lesson 1.54: Project 2: Fire, Water, Earth
  55. 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.

Decompose programs and organise shared work9 student pages · original artwork

Opening your PDF…

Swipe sideways across the worksheet on a small screen, or use “Answer list” for larger controls.

TAKE YOUR PRACTICE OFFLINE

3. Download the student worksheet

All 9 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

Download worksheet PDF ↓

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 9 worksheets

Worksheet 1

  1. Question 1: What makes an alternative decomposition useful? complete responsibilities that fit together clearly
  2. Question 2: What can a reusable routine reduce? repeated development of the same behaviour

Worksheet 2

  1. Question 3: After a move reaches 25, what should happen? end the game with that player as winner

Worksheet 3

  1. Question 4: Which plan groups ordinary movement and board links together? B
  2. Question 5: Can both plans be valid for the same game? yes, if each covers the rules and its parts fit together

Worksheet 4

  1. Question 6: What data type is returned by this movement part? integer
  2. Question 7: Who stores the returned position for the active player? the caller
  3. Question 8: What happens to the other player’s position during this call? it is unchanged

Worksheet 5

  1. Question 9: Move from 1 with die 3 14
  2. Question 10: Move from 10 with die 4 14
  3. Question 11: Move from 18 with die 4 11
  4. Question 12: Move from 23 with die 2 25
  5. Question 13: Move from 23 with die 3 23

Worksheet 6

  1. Question 14: The display expects an integer but receives text Square 14. What needs attention? the parts disagree about the output format

Worksheet 7

  1. Question 15: How does decomposition help understanding? it makes smaller responsibilities easier to reason about
  2. Question 16: Why might a team allocate graphics to a visual specialist? the responsibility matches that person’s expertise
  3. Question 17: Why reuse one movement routine for both players? the same rule can be applied to each player’s position
  4. Question 18: What is needed after separately developed parts are combined? test their interactions as well as individual behaviour

Worksheet 8

  1. Question 19: Select one broad game responsibility from either page 3 plan and expand it into a clear algorithm using the complete page 2 rules. State its inputs, outputs and completion condition. If choosing movement, trace all five page 5 cases; for another responsibility, design relevant stated cases. Explain how the part could be reused for both players and what remains outside its responsibility. Keep the algorithm, traces and a correction or question; actual program execution may be Pending. Appropriate broad responsibility with detailed ordered algorithm and decisions, complete within its stated boundary. Movement: candidate=position+die; overshoot>25 returns unchanged position; otherwise one link4->14 or22->11, else candidate. Page 5 results: 14, 14, 11, 25, 23. No link chaining, extra-six turn or automatic bounce; caller determines win/handover. Other responsibilities accepted with correct supplied rules, relevant input/output/completion and meaningful traces. Reuse parameterises active-player data rather than copies all code or overwrites the other player. Clear scope, actual algorithm/trace evidence, correction/question and honest execution status. Grown-up review; personal evidence is required.

Worksheet 9

  1. Question 20: Create a third decomposition of the same mini game, with a grouping meaningfully different from both page 3 plans. Check every rule is covered. Explain one reusable part and suitable work for two different specialists. Write a precise input/output agreement between two parts, including types, value meanings and who stores or displays the result. Compare with a partner if available or review individually, noting feedback or peer exchange Pending, one justified revision, your contribution and the need for integration testing. Third complete justified grouping, for example Game-state data, Turn controller, Movement/board rules and Presentation, with explicit allocation of setup/die/links/overshoot/win/handover and display. Meaningful difference rather than renamed identical list. Valid repeated routine and specialist match. Interface specifies named input/output types, ranges and meanings, caller responsibilities and incompatible format risk; movement contract from page 4 acceptable if integrated in the new plan. Actual review/feedback or individual comparison with peer exchange Pending, retained revision, own contribution and integration-test need. No invented collaboration or implemented full game claimed. Grown-up review; personal evidence is required.
Back to my workbook ↑

Curriculum & workbook reference

Computing for your homeschool day

Explore Decompose programs and organise shared work 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.