Pseudocode: user interaction loop with a menu
A menu loop: repeat shows the menu, reads the choice, picks an action with if or else if, and stops on the exit choice. Any other value gets an invalid choice message.
Understanding Pseudocode: user interaction loop with a menu in QCE Digital Solutions Unit 2
What it does: The input keyword reads the choice inside the loop each time the menu is shown, so a new value is tested on every pass. else if chains the menu options together so only the action for the matching choice runs. Repeat-until keeps looping until its condition is true. 'choice = 4' becomes true only when the user picks Exit. 'choice <> 4' would end the loop on any other choice.
Common mistakes: The menu loop must read the user's choice with input choice. print choice only displays a value that was never entered, so the if and the until have nothing to test. Line 2 should be input choice. The menu says Exit is option 3, but the loop ends on choice = 2. The menu text must match the exit choice. Line 2 should print "1 Add 2 Exit".
Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.
This module's key terms are also in a printable crossword (Modules 234–285) and word search (Modules 234–409).
Take this worksheet further — free with Cloodit
Each concept is reinforced from every angle — learned, then applied, then tested.
Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.
Over 100 of them, across seven natural biomes.
Turns their work into revision material ready for Flash Cards and Exam study.
Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.
Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.
Quick Questions
Match the Pairs
Key Term
repeat ... until choice = 4Fill in the Blanks
Spot the Error
Student with a class code? Join your class →