GRADE 8 · COMPUTING · UNIT 1 · LESSON 1.50

Computational thinking and programming

Transmit text and use received data in conditions

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

Topic 1.50 · Transmit text and use received data in conditions9 fillable worksheet pagesRead at your own pace

LET’S TRACE, REASON AND TEST

Transmit text and use received data in conditions

Received strings can be compared with agreed commands. Exact spelling and case matter unless a normalisation step is explicitly programmed. State what the receiver does with an unrecognised command.

Today’s two goals
  • Compare single-character and whole-string messages and choose outputs from received text.
  • Explain my method and support it with a labelled trace, example or test record.
Original PaxaKids illustration for Transmit text and use received data in conditions. 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

A handler responding to "GO" does not automatically respond to "go". A fallback can display Unknown, but only if that behaviour is in the program.

Try before your workbook

If the only recognised command is "LEFT", is "Left" guaranteed to trigger it?

Explore the clues

Tap one card to find out more.

Understand the idea

Received strings can be compared with agreed commands. Exact spelling and case matter unless a normalisation step is explicitly programmed. State what the receiver does with an unrecognised command.

Concept to practise: Transmit text and use received data in conditions.

Work through an example

A handler responding to "GO" does not automatically respond to "go". A fallback can display Unknown, but only if that behaviour is in the program.

Try before your workbook

If the only recognised command is "LEFT", is "Left" guaranteed to trigger it?

Check my readiness thinking

No. Exact equality treats those strings differently. Either use the specified spelling or deliberately define and test a normalisation policy.

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 how text is packaged into messages

A string may contain one character or a whole word. Sending five one-character strings makes five separate message requests. Sending the complete five-character word in one sendString call makes one request.

Predict from the actual calls and payloads, not only from what a display appears to spell. Keep an ideal received-in-order trace separate from actual radio observations.

Read a complete five-message sender and receiver

Button A requests five one-character messages. Pauses aid observation without guaranteeing delivery or exact timing. The receiver shows each arriving string through its receivedString parameter.
Character sender
radio.setGroup(17)
input.onButtonPressed(Button.A,
    function () {
        radio.sendString("R")
        basic.pause(1200)
        radio.sendString("E")
        basic.pause(1200)
        radio.sendString("A")
        basic.pause(1200)
        radio.sendString("D")
        basic.pause(1200)
        radio.sendString("Y")
    })
String receiver
radio.setGroup(17)
radio.onReceivedString(
    function (receivedString) {
        basic.showString(receivedString)
    })

Compare separate characters with one whole string

Assume group 17 and the page 2 receiver ready, with complete ordered delivery for this ideal trace. Both approaches spell the same word but use different message boundaries.
Compare separate characters with one whole string — original model
Sender callsMessage countPayloads in order
Five calls: "R", "E", "A", "D", "Y"5R | E | A | D | Y
One call: sendString("READY")1READY

Modify both the word and the input event

This complete modified sender sends TEAM character by character on A, and GO character by character on B. Keep the complete page 2 receiver.
Original Paxa modified character sender
radio.setGroup(17)
input.onButtonPressed(Button.A,
    function () {
        radio.sendString("T")
        basic.pause(1200)
        radio.sendString("E")
        basic.pause(1200)
        radio.sendString("A")
        basic.pause(1200)
        radio.sendString("M")
    })
input.onButtonPressed(Button.B,
    function () {
        radio.sendString("G")
        basic.pause(1200)
        radio.sendString("O")
    })

Make different whole-word messages on a shake

Each complete program can send and receive. Shaking Device A requests HELLO for Device B; shaking Device B requests READY for Device A. A gesture handler runs on the specified movement. Test one direction at a time.
Device A
radio.setGroup(17)
input.onGesture(Gesture.Shake,
    function () {
        radio.sendString("HELLO")
    })
radio.onReceivedString(
    function (receivedString) {
        basic.showString(receivedString)
    })
Device B
radio.setGroup(17)
input.onGesture(Gesture.Shake,
    function () {
        radio.sendString("READY")
    })
radio.onReceivedString(
    function (receivedString) {
        basic.showString(receivedString)
    })

Use received text in a condition

These complete original programs agree that care means Heart and joy means Happy. The receiver compares exact string contents and chooses an icon with showIcon. It has no else output, so an unrecognised string makes no new display instruction.
Command sender
radio.setGroup(17)
input.onButtonPressed(Button.A,
    function () {
        radio.sendString("care")
    })
input.onButtonPressed(Button.B,
    function () {
        radio.sendString("joy")
    })
Conditional receiver
radio.setGroup(17)
radio.onReceivedString(
    function (receivedString) {
        if (receivedString == "care") {
            basic.showIcon(
                IconNames.Heart)
        } else if (receivedString == "joy") {
            basic.showIcon(
                IconNames.Happy)
        }
    })

Trace recognised and unrecognised commands

Use the page 6 receiver. For each row assume the event receives exactly the stated payload. Write Heart, Happy or No change. No change means this event makes no display instruction; it does not mean the previous display was cleared.
Trace recognised and unrecognised commands — original model
Received textRequested display
"care"{'clue': 'Requested icon or No change', 'prompt': 'Receiver payload "care"', 'answers': ['Heart']}
"joy"{'clue': 'Requested icon or No change', 'prompt': 'Receiver payload "joy"', 'answers': ['Happy']}
"CARE"{'clue': 'Requested icon or No change', 'prompt': 'Receiver payload "CARE"', 'answers': ['No change']}
"ready"{'clue': 'Requested icon or No change', 'prompt': 'Receiver payload "ready"', 'answers': ['No change']}

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.

Transmit text and use received data in conditions9 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.2 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: How many messages does one sendString("READY") call request? one
  2. Question 2: Which is a one-character string? "R"

Worksheet 2

  1. Question 3: How many sendString calls are in this A handler? 5
  2. Question 4: How many characters are in each transmitted string? 1

Worksheet 3

  1. Question 5: Does displaying the same letters prove the same number of messages? no, inspect the calls and payload boundaries
  2. Question 6: What does showString do when the text is wider than the LED screen? scrolls the text left
  3. Question 7: Name the page 2 parameter used to show the received text. receivedString

Worksheet 4

  1. Question 8: Write the intended payloads requested by Button A in order. T, E, A, M / T,E,A,M
  2. Question 9: Write the intended payloads requested by Button B in order. G, O / G,O

Worksheet 5

  1. Question 10: Which gesture triggers each send? Shake / shake
  2. Question 11: What whole string is requested when Device B is shaken? READY

Worksheet 6

  1. Question 12: Which received string requests the Heart icon? care
  2. Question 13: What is compared by the receiver? the received string contents

Worksheet 7

  1. Question 14: Receiver payload "care" Heart
  2. Question 15: Receiver payload "joy" Happy
  3. Question 16: Receiver payload "CARE" No change
  4. Question 17: Receiver payload "ready" No change

Worksheet 8

  1. Question 18: Use the complete page 2 pair to predict message count, characters per message, received parameter and each device’s output. Test in an actually supported environment or with devices; record actual results or Pending. Modify the word and event using page 4, then compare the one-call whole-word approach. Make the reciprocal shake pair on page 5. Keep full saved versions, device assignments, predictions, actual records or labelled paper traces, corrections and retests. Describe your contribution and actual partner feedback or Pending. Attach the evidence and cite it here. Baseline five one-character message requests R/E/A/D/Y, receivedString used by receiver; sender has no local display instructions. Complete ordered delivery is an explicit model assumption, not measured evidence. Modified A T/E/A/M and B G/O; whole READY uses one send call. Reciprocal Device A Shake HELLO and Device B Shake READY, both group17 with matching string receive event. Identify all saved versions/devices; predict before recording actual supported-environment/device observations or Pending. Keep missing/unexpected results honestly, distinguish model/stub checks from radio tests, document corrections/retests and actual individual/shared work. Grown-up review; personal evidence is required.

Worksheet 9

  1. Question 19: Use or recreate the complete page 6 pair. Make a protocol table linking sender input, exact transmitted string and receiver output. Predict A, B, a changed-case string and an unknown string before testing. Record actual results or Pending and explain what happens to the previous display when no branch matches. Agree one new command, extend both programs consistently, and keep full code, table, prediction, correction/retest evidence and a brief reflection with a next step. State any practical or partner work still pending. Complete pair group17; sender A care and B joy; receiver care->Heart, joy->Happy, exact comparisons. Changed-case CARE and unknown ready match neither branch and make no display instruction; previous display remains unless other code changes it. Explain parameter contents rather than identifier text. New distinct agreed command has consistent sender input/payload and receiver condition/output, with meaningful predicted known/unknown tests. Full saved source and protocol table retained, actual or Pending evidence and explicit model limits; contribution, reflection and useful next step. No invented simulator, physical radio, partner or learner execution. Grown-up review; personal evidence is required.
Back to my workbook ↑

Curriculum & workbook reference

Computing for your homeschool day

Explore Transmit text and use received data in conditions 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.