GRADE 7 · COMPUTING · UNIT 2 · LESSON 2.5
Decomposing problems: Creating a smart solution
Correcting errors using a flowchart
Read a little. Try the workbook. Check your answers. Choose one section below to get started.
LET’S TRACE, REASON AND TEST
Correcting errors using a flowchart
A flowchart states the intended behaviour and helps locate mismatches in code. Check the input, condition, instruction order, spelling, case, quotation marks and pauses. In the imported micro:bit API, sleep uses milliseconds and the function name is lowercase.
- Trace the intended button-response sequence one instruction at a time.
- Compare code with a flowchart to identify a mismatch in syntax, order or output.

Explore the clues
Tap one card to find out more.
Understand the idea
A flowchart states the intended behaviour and helps locate mismatches in code. Check the input, condition, instruction order, spelling, case, quotation marks and pauses. In the imported micro:bit API, sleep uses milliseconds and the function name is lowercase.
Concept to practise: Correcting errors using a flowchart.
Work through an example
If the plan says scroll a word before displaying a face, reversing those commands changes the sequence. sleep(1000) is a one-second pause; Sleep(1000) is a different name. Repair one mismatch, then trace and test again.
Try before your workbook
A sequence needs a two-second pause between two images. What pause value suits sleep, and what other detail must match the flowchart?
Check my readiness thinking
Use sleep(2000) for 2000 milliseconds. The images must still appear in the specified order, under the correct input condition. A correct delay alone does not fix a reversed sequence.
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.
Trace, compare and repair
Maya checks the plan before changing a program. A program can run and still produce the wrong order. Exact names, quotation marks and indentation also matter.
Intended plan A: Diamonds
Polling condition: A held now?
- Scroll Diamonds
- Pause 1000 ms
- Display large diamond
- Pause 1000 ms
- Display small diamond
- Pause 1000 ms
Intended plan B: Faces
Polling condition: B held now?
- Scroll Faces
- Pause 1000 ms
- Display happy face
- Pause 1000 ms
- Display sad face
- Pause 1000 ms
Pause and check exact syntax
| Instruction | Meaning |
|---|---|
| sleep(1000) | Pause for 1 second. |
| sleep(500) | Pause for half a second. |
| display.scroll("Faces") | Scroll the quoted text. |
| display.show(Image.HAPPY) | Display the supported image constant. |
Actual A snippet: follow what is written
A: LOGIC FAULTS TO INVESTIGATE
if button_a.is_pressed():
display.show(Image.DIAMOND_SMALL)
display.scroll("Diamonds")
display.show(Image.DIAMOND)
sleep(1000)Actual B snippet: inspect the test as well
B: LOGIC FAULTS TO INVESTIGATE
if button_a.is_pressed():
display.scroll("Faces")
sleep(1000)
display.show(Image.SAD)
display.show(Image.HAPPY)
sleep(1000)
Try one step with Paxa!
Use the API for the chosen editor. Label paper traces, simulator runs and physical tests accurately; ask a grown-up before connecting equipment. Save personal responses before leaving.
Our Unit 2 learning path
- Lesson 2.1: All about software
- Lesson 2.2: Introducing the micro:bit
- Lesson 2.3: Using Python with the micro:bit
- Lesson 2.4: The micro:bit Python environment
- Lesson 2.5: Correcting errors using a flowchart
- Lesson 2.6: Using sensors in programming
- Lesson 2.7: Flowcharts for algorithm planning
- Lesson 2.8: Algorithmic solutions and data types
- Lesson 2.9: Planning a smart solution
- Lesson 2.10: Effective testing
- Lesson 2.11: Evaluating a program
- Lesson 2.12: Testing accelerometer gestures
- Lesson 2.13: Protecting a museum crown
- Lesson 2.14: Final project
- Lesson 2.15: Evaluation
- Lesson 2.16: What can you do?
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 the 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 does debugging involve? finding, correcting and retesting errors
- Question 2: What should a code-to-flowchart comparison preserve? the actual instruction order
Worksheet 2
This page introduces the activity. There are no marked responses on this sheet.
Worksheet 3
This page introduces the activity. There are no marked responses on this sheet.
Worksheet 4
- Question 3: Which call pauses for one second? sleep(1000)
- Question 4: How many milliseconds are in 2 seconds? 2000 / 2,000
- Question 5: Which is valid for scrolling this literal text? display.scroll("Faces")
Worksheet 5
- Question 6: Which output comes first in this snippet? the small diamond
- Question 7: Which image is left after the snippet’s final pause? the large diamond
Worksheet 6
- Question 8: Which physical button does this fragment actually test? A
- Question 9: Which image appears immediately after SAD, with no deliberate pause between them? HAPPY
Worksheet 7
- Question 10: Chart the actual A and B snippets from pages 5–6, including their tested buttons, output order and pauses. Compare with plans 2–3 and annotate the errors; keep the written faulty order in your charts. A snippet: test A, small diamond, Diamonds text, large diamond, 1000 ms pause, return to checks; no delay between the two image calls except the intervening scrolling text. B snippet: wrongly tests A; Faces text, 1000 ms, Sad, Happy immediately, 1000 ms, return to checks. Charts need decision diamonds and explicit False bypass/return, True output path, arrows, output parallelograms and delay processes. Compare with required A Diamonds then pause then large then pause then small then pause; B tests B, Faces then pause then Happy then pause then Sad then pause. These are syntactically valid fragments requiring microbit import and enclosing polling loop; no execution flow is claimed for invalid syntax. Grown-up review; personal evidence is required.
Worksheet 8
- Question 11: Repair both fragments to match pages 2 and 3. Explain the button, order and delay corrections. Trace A alone, B alone and neither held. Then test the corrected revision in the editor simulator or on a board, recording expected and actual outputs, pauses, method and any retest. Explain why keeping a button held can repeat its sequence. Correct A: button_a.is_pressed(), scroll Diamonds, sleep(1000), show DIAMOND, sleep(1000), show DIAMOND_SMALL, sleep(1000). Correct B: button_b.is_pressed(), scroll Faces, sleep(1000), show HAPPY, sleep(1000), show SAD, sleep(1000). Import microbit and enclose checks in while True with correct indentation; small final polling delay acceptable. Use lowercase sleep. A alone runs A sequence, B alone B sequence, neither adds no new display command (last image may remain). is_pressed tests held state; if still held at next poll it repeats. Three explicit one-second pauses per sequence plus scroll time, not exactly three seconds overall. Evidence names source revision, trace and observed method/result; pending actual tests labelled honestly. Timing observations are not inferred from API stub checks. No simultaneous-button guarantee and no numeric scoring. Grown-up review; personal evidence is required.
Curriculum & workbook reference
- Cambridge Lower Secondary Computing 7 Student’s Book — pages 58–62
- PaxaKids Grade 7 Computing Lesson 2.5: Correcting errors using a flowchart — pages 1–8
Computing for your homeschool day
Explore Correcting errors using a flowchart with this free Grade 7 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
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.
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 book pages identify the related teaching topic. 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.
