GRADE 8 · COMPUTING · UNIT 1 · LESSON 1.10

Computational thinking and programming

Ordered ELSEIF and fallback ELSE

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

Topic 1.10 · Ordered ELSEIF and fallback ELSE12 fillable worksheet pagesRead at your own pace

LET’S TRACE, REASON AND TEST

Ordered ELSEIF and fallback ELSE

An ordered IF/ELSEIF chain checks conditions until one is true. Only its branch runs; later conditions in that chain are skipped. Use a final ELSE for cases not matched earlier.

Today’s two goals
  • Check conditions in order, stop choosing after the first match, and add a fallback for unmatched input.
  • Explain my method and support it with a labelled trace, example or test record.
Original PaxaKids illustration for Ordered ELSEIF and fallback ELSE. 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 score >= 20 selects Gold and ELSEIF score >= 10 selects Silver, a score of 25 selects Gold. Although 25 is also at least 10, the earlier true branch wins.

Try before your workbook

With the same order, what does score 15 select? What would a final ELSE cover?

Explore the clues

Tap one card to find out more.

Understand the idea

An ordered IF/ELSEIF chain checks conditions until one is true. Only its branch runs; later conditions in that chain are skipped. Use a final ELSE for cases not matched earlier.

Concept to practise: Ordered ELSEIF and fallback ELSE.

Work through an example

If score >= 20 selects Gold and ELSEIF score >= 10 selects Silver, a score of 25 selects Gold. Although 25 is also at least 10, the earlier true branch wins.

Try before your workbook

With the same order, what does score 15 select? What would a final ELSE cover?

Check my readiness thinking

It selects Silver: the first condition is false and the second is true. A final ELSE covers scores below 10 in this stated model.

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 the first match, then leave the chain

An ELSEIF chain checks alternatives in their written order. If the IF test is False, try the next ELSEIF. Once a condition is True, execute its block and skip later alternatives in that chain.

A final ELSE supplies a fallback when every explicit condition is False. It has no condition of its own. After the chain, continue with the next outside statement.

Investigate a chain without a fallback

This original palette plan compares exact lowercase strings. It does not change case or remove spaces. No ELSE and no shared output are present.
ORIGINAL PALETTE PLAN A
INPUT colour
IF colour == "teal" THEN
    OUTPUT "Sea palette"
ELSEIF colour == "coral" THEN
    OUTPUT "Sunset palette"
ENDIF

Give the unmatched route an output

This repaired original diagram adds a fallback after both comparisons are False. The existing matched routes keep their messages. Follow only the arrows for the chosen route.
Give the unmatched route an output — original labelled workbook model. The following text version gives its labels and values.
Give the unmatched route an output · original PaxaKids model.
Read this model’s labels and values
Before
    1. start
    2. Start
    1. input
    2. INPUT colour
Routes
    1. colour == "teal"
    2. output
    3. Sea
      palette
    1. colour == "coral"
    2. output
    3. Sunset
      palette
Otherwise
Choose another palette

Match a repaired diagram to its pseudocode

The final ELSE belongs after all explicit tests and before ENDIF. It adds an intentional unmatched result; it does not change what teal or coral produces.
ORIGINAL PALETTE PLAN B
INPUT colour
IF colour == "teal" THEN
    OUTPUT "Sea palette"
ELSEIF colour == "coral" THEN
    OUTPUT "Sunset palette"
ELSE
    OUTPUT "Choose another palette"
ENDIF

Read the supplied original C02 learning-route plan

score is a fictional game tally from the original practice resource, not a mark for this workbook. OR in the first test means at least one comparison is True. An out-of-range tally reaches Invalid score. Every route then displays Route check finished.
SUPPLIED ORIGINAL PAXA C02 PLAN
INPUT score
IF score < 0 OR score > 30 THEN
    OUTPUT "Invalid score"
ELSEIF score >= 24 THEN
    OUTPUT "Challenge route"
ELSEIF score >= 15 THEN
    OUTPUT "Practice route"
ELSE
    OUTPUT "Warm-up route"
ENDIF
OUTPUT "Route check finished"

Trace threshold boundaries and an invalid input

Use the page 5 plan. Record only the first matching test or ELSE and the route message. The shared line Route check finished follows every row’s route message.
Trace threshold boundaries and an invalid input — original model
Game tally scoreFirst matching test / fallbackRoute message
14{'clue': 'First match', 'prompt': 'Tally 14: first matching test or fallback', 'answers': ['ELSE']}{'clue': 'Route message', 'prompt': 'Tally 14: route message before shared output', 'answers': ['Warm-up route']}
15{'clue': 'First match', 'prompt': 'Tally 15: first matching test or fallback', 'answers': ['score >= 15']}{'clue': 'Route message', 'prompt': 'Tally 15: route message before shared output', 'answers': ['Practice route']}
23{'clue': 'First match', 'prompt': 'Tally 23: first matching test or fallback', 'answers': ['score >= 15']}{'clue': 'Route message', 'prompt': 'Tally 23: route message before shared output', 'answers': ['Practice route']}
24{'clue': 'First match', 'prompt': 'Tally 24: first matching test or fallback', 'answers': ['score >= 24']}{'clue': 'Route message', 'prompt': 'Tally 24: route message before shared output', 'answers': ['Challenge route']}
31{'clue': 'First match', 'prompt': 'Tally 31: first matching test or fallback', 'answers': ['score < 0 OR score > 30']}{'clue': 'Route message', 'prompt': 'Tally 31: route message before shared output', 'answers': ['Invalid score']}

Investigate a case-sensitive vowel chain

This original plan recognises exactly the five lowercase strings shown. It does not establish whether every unmatched input is a consonant or even a letter.
ORIGINAL VOWEL MATCHER
INPUT symbol
IF symbol == "a" THEN
    OUTPUT "Vowel a"
ELSEIF symbol == "e" THEN
    OUTPUT "Vowel e"
ELSEIF symbol == "i" THEN
    OUTPUT "Vowel i"
ELSEIF symbol == "o" THEN
    OUTPUT "Vowel o"
ELSEIF symbol == "u" THEN
    OUTPUT "Vowel u"
ELSE
    OUTPUT "No lowercase vowel match"
ENDIF

Predict and check different input types

Use the page 7 plan exactly. Each row is a separate run with one complete string input. Trace comparisons until a match, or until all are False.
Predict and check different input types — original model
Input stringExact output
"a"{'clue': 'Output', 'prompt': 'Vowel matcher input a', 'answers': ['Vowel a']}
"E"{'clue': 'Output', 'prompt': 'Vowel matcher input uppercase E', 'answers': ['No lowercase vowel match']}
"?"{'clue': 'Output', 'prompt': 'Vowel matcher input question mark', 'answers': ['No lowercase vowel match']}
"u"{'clue': 'Output', 'prompt': 'Vowel matcher input u', 'answers': ['Vowel u']}

Extend choices in a breakfast menu

Use this fictional menu: 1 = porridge; 2 = toast; 3 = fruit bowl. Match the entered integer to its named option; any other integer gives Unknown choice. Add a further question only inside the chosen option that needs it.

For a toast extension, ask topping: 1 = jam; 2 = spread; any other topping gives Unknown topping. Porridge and fruit bowl must not ask for a toast topping.

Plan an accurate selection explanation

Plan an accurate selection explanation — original model
PartEvidence to include
Conditions and comparisonsA True/False test, all six comparison operators and a boundary example.
Simple IFA pseudocode example with a False case that skips the inside action.
IF THEN ELSETwo alternatives and test inputs reaching both.
ELSEIF and fallbackFirst-match order, a skipped later test and an unmatched input.
Everyday example and demoA clear nonprogram example plus a checked code or diagram trace.
Presentation and reflectionA script, actual delivery or Pending, contribution evidence and a next step.

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.

Ordered ELSEIF and fallback ELSE12 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 12 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 12 worksheets

Worksheet 1

  1. Question 1: When is the second condition in an ELSEIF chain checked? only when the earlier condition is False
  2. Question 2: What happens after a matching alternative executes? later alternatives in that chain are skipped

Worksheet 2

  1. Question 3: For colour = "teal", what is displayed? Sea palette
  2. Question 4: For colour = "lime", what is displayed as written? nothing
  3. Question 5: After teal matches, is the coral comparison checked? No: it is skipped

Worksheet 3

This page introduces the activity. There are no marked responses on this sheet.

Worksheet 4

  1. Question 6: Which keyword introduces the fallback block? ELSE
  2. Question 7: For colour = "Teal", which result follows under these exact-case rules? Choose another palette
  3. Question 8: Which position fits the new fallback output in the diagram? on the route where both comparisons are False

Worksheet 5

  1. Question 9: For score = 26, which route message is selected? Challenge route
  2. Question 10: Why is score >= 15 skipped after score >= 24 matches? the first matching alternative already selected the route

Worksheet 6

  1. Question 11: Tally 14: first matching test or fallback ELSE
  2. Question 12: Tally 14: route message before shared output Warm-up route
  3. Question 13: Tally 15: first matching test or fallback score >= 15
  4. Question 14: Tally 15: route message before shared output Practice route
  5. Question 15: Tally 23: first matching test or fallback score >= 15
  6. Question 16: Tally 23: route message before shared output Practice route
  7. Question 17: Tally 24: first matching test or fallback score >= 24
  8. Question 18: Tally 24: route message before shared output Challenge route
  9. Question 19: Tally 31: first matching test or fallback score < 0 OR score > 30
  10. Question 20: Tally 31: route message before shared output Invalid score

Worksheet 7

  1. Question 21: How many explicit comparison conditions are present? 5
  2. Question 22: When does the fallback run? when all five exact comparisons are False

Worksheet 8

  1. Question 23: Vowel matcher input a Vowel a
  2. Question 24: Vowel matcher input uppercase E No lowercase vowel match
  3. Question 25: Vowel matcher input question mark No lowercase vowel match
  4. Question 26: Vowel matcher input u Vowel u
  5. Question 27: What does the fallback prove about input "?"? it matched none of the five lowercase vowel strings

Worksheet 9

  1. Question 28: Where should the topping input belong? inside the toast alternative
  2. Question 29: How can a three-option question be represented with binary decision diamonds? use an ordered chain of comparisons and a fallback

Worksheet 10

  1. Question 30: Which statement about current Python is accurate? it has if/elif/else and also match/case; this lesson focuses on if/elif/else
  2. Question 31: What can checking only three rejected strings establish about another string? only that it did not match those three, not that it is secure

Worksheet 11

  1. Question 32: Write a complete ordered menu plan for the page 9 fictional breakfast choices, with a fallback. Add the toast-only topping question and both topping outcomes plus its fallback. Predict and check a case for every final outcome, including an unknown menu number and unknown topping. Then revise one question from your earlier recommendation quiz to allow at least three choices; show the new ELSEIF structure or linked binary comparisons and its unmatched route. Record actual test evidence, revision and any partner exchange still Pending. Menu IF choice==1 -> porridge; ELSEIF==2 -> ask topping, nested IF topping==1 jam; ELSEIF==2 spread; ELSE Unknown topping; ENDIF; ELSEIF choice==3 -> fruit bowl; ELSE Unknown choice; ENDIF. Distinct outputs and message order intentional, topping requested only for toast. Minimum routes (1), (2,1), (2,2), (2,9), (3), (9), or equivalent invalid integers. Extended quiz has at least three explicit choices with first-match structure and fallback; every outcome reachable, no dangling routes. Require honest trace/run evidence, actual source revision and Pending partner status if unavailable. No numerical grading. Grown-up review; personal evidence is required.

Worksheet 12

  1. Question 33: Prepare a short audio or video presentation with a script, using the six-part plan on page 10. Include a real-life decision example, pseudocode for simple IF and IF THEN ELSE, comparison operators, an ordered ELSEIF example and a boundary/fallback demonstration. Use your palette or menu evidence, and explain why reordering overlapping >= 24 and >= 15 tests can change an output. Present to an available group and answer questions if possible. Record the script or file reference, what was actually delivered, one evidenced contribution and how any disagreement was handled. Give a next step without numeric ratings; record unavailable recording, presentation or group work as Pending. Require coherent script and accurate definitions, all six comparisons separately from Boolean operations, original everyday example and pseudocode examples. Show True/False cases, optional ELSE for simple IF, exclusive selected alternatives, first-match skips and fallback. At game tally 26, >=24 first gives Challenge; >=15 first gives Practice and skips >=24. Evidence should identify exact script/file/trace; actual recording, delivery and audience questions only if performed. Solo plan/script may be complete with media/presentation/peer stages Pending. Reflect on real contribution/disagreement or explicitly no group, and specific next action. No invented password security, categorical no-case claim or numeric score. Grown-up review; personal evidence is required.
Back to my workbook ↑

Curriculum & workbook reference

Computing for your homeschool day

Explore Ordered ELSEIF and fallback ELSE 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.