Turning pseudocode or a flowchart into JavaScript
Translates the pseudocode step SET score TO 0. Each step of pseudocode or a flowchart becomes one JavaScript statement: ask is prompt, a decision diamond is if, a loop arrow is while.
Understanding Turning pseudocode or a flowchart into JavaScript in ACARA Digital Technologies Years 7–8
What it does: SET means store a value in a variable, which JavaScript does with let, a name, = and the value. The yes/no question in a diamond becomes the condition in brackets after if. The yes path goes inside the braces. ASK means getting input from the user, so it becomes prompt(). console.log() only displays output. An arrow that goes back to the diamond means repeat, so use a loop. An if runs its code only once. The condition must use the comparison >= to match the pseudocode. A single = assigns a value and does not compare. Run the program and follow the flowchart step by step to see if the results match. Line count does not prove it is correct.
Common mistakes: The pseudocode step SET score TO 0 is an assignment, so it needs a single = sign. The == symbol compares values and cannot be used to create a variable. It should be let score = 0;. A parallelogram or PRINT step that shows output becomes console.log() in JavaScript. There is no print() function here. It should be console.log(name, age);.
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 599–610) and word search (Modules 583–613).
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
let score = 0;Fill in the Blanks
Spot the Error
Student with a class code? Join your class →