Cleaning data in pseudocode
A loop that checks each record with if conditions, trims and standardises text, rejects or fixes bad values, and writes only the good records to a new clean array, leaving the raw data untouched.
Understanding Cleaning data in pseudocode in QCE Digital Solutions Unit 3
What it does: The if condition detects the missing mark, and continue moves on to the next record without writing it to the clean array. A cleaning algorithm writes only the good records to a new clean array. Deleting from raw destroys the original data you may need to check later. Trimming removes the extra spaces and capitalise fixes the case, so " aVA " becomes "Ava". Copying it unchanged keeps the mess. Converting to one case standardises every spelling variant to "QLD". The wrong option only keeps records that already match and rejects the variants instead of fixing them. No mark can be both below 0 and above 100, so AND never catches anything. OR rejects a mark outside the valid range.
Common mistakes: The test is back to front. It only lets blank names through and drops the good ones. To skip records with missing values, check that name != "". Assignment goes the wrong way. The variable being set must be on the left: town <- lower(town). Otherwise the text is never standardised to lower case.
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 194–250) and word search (Modules 194–337).
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
cleaning algorithmFill in the Blanks
Spot the Error
Student with a class code? Join your class →