Flowchart to Pseudocode Converter & Step-by-Step Guide
Master how to deconstruct algorithm flowcharts and write pristine Cambridge pseudocode. Learn decision diamond translation, loop detection, and examiner marking criteria.
Interactive Diagram-to-Pseudocode Explorer
Click any algorithm pattern below:1. Standard Cambridge Flowchart Symbols to Pseudocode Mapping
Every flowchart on Cambridge IGCSE and A-Level examinations is constructed from five standard ISO shapes. When converting to pseudocode, each shape maps to a distinct language keyword:
Defines the algorithm boundary. Maps to the entry point and exit point of a program, procedure, or function.
START ➔ Program start
STOP ➔ ENDPROCEDURE
Interaction with hardware or virtual files. Slanted sides denote reading keyboard input or printing to screen.
INPUT Score
OUTPUT "Result: ", Score
Calculations and assignments. Must have sharp 90-degree corners to distinguish from rounded terminators.
Total ← Total + Score
Count ← Count + 1
Evaluates a boolean condition. Must have exactly two outgoing branches, both clearly labelled Yes and No (or True/False).
IF Score >= 50 THEN
WHILE Count < 10 DO
A process box with vertical lines inside each end, denoting a call to a modular procedure or function defined elsewhere.
CALL ValidateInput()
Result ← CalcTax(Price)
Lines with directional arrowheads connecting nodes. Essential for distinguishing sequential flow from iteration loopbacks.
Down ➔ Sequence
Upward arrow ➔ Loop
2. Translating Decision Diamonds into IF-THEN-ELSE Statements
When a decision diamond branches in two forward directions that later rejoin, it translates directly into a Cambridge selection construct:
- Identify the Condition: The question inside the diamond (e.g.
Marks >= 50?) becomes the boolean expression afterIF. - Follow the "Yes" (True) Branch: All process or I/O boxes on the Yes path are written under the
THENclause. - Follow the "No" (False) Branch: If boxes exist on the No branch, write them inside the
ELSEclause. If the No branch simply bypasses the process and joins the main line, omitELSE. - Close with ENDIF: When both paths converge at a common flowline junction, close the block with
ENDIF.
OUTPUT "Pass"
ELSE
OUTPUT "Fail"
ENDIF
3. Translating Loop Arrows into WHILE and REPEAT UNTIL Loops
When a flowline loops upward to re-enter the algorithm above an earlier step, it represents iteration. To determine whether to use WHILE or REPEAT...UNTIL, check the position of the decision diamond:
- Pre-Condition (WHILE ... DO ... ENDWHILE): The decision diamond is placed before the loop processes. If the condition is false upon entry, the loop body is bypassed entirely (0 executions possible). The Yes branch enters the body, and an upward arrow leads back to the diamond.
- Post-Condition (REPEAT ... UNTIL): The process boxes execute first, and the decision diamond sits at the bottom. The loop body is guaranteed to execute at least once. The No branch loops upward, while the Yes branch exits downward when the termination condition is met.
4. Step-by-Step Worked Exam Example (IGCSE Past Paper Scenario)
Scenario: A student inputs scores between 0 and 100 until -1 is entered. The algorithm calculates the running total and outputs the average.
Flowchart Analysis:
- Terminator:
START - Rectangle:
Total ← 0,Count ← 0 - Parallelogram:
INPUT Score - Diamond (Loop check):
Score <> -1?- Yes path:
Total ← Total + Score,Count ← Count + 1,INPUT Score➔ Loops back to Diamond. - No path: Exits loop to calculate average.
- Yes path:
- Rectangle:
Average ← Total / Count - Parallelogram:
OUTPUT "Average: ", Average - Terminator:
STOP
Official Cambridge Pseudocode Solution:
DECLARE Total : INTEGER
DECLARE Count : INTEGER
DECLARE Score : INTEGER
DECLARE Average : REAL
Total ← 0
Count ← 0
INPUT Score
WHILE Score <> -1 DO
Total ← Total + Score
Count ← Count + 1
INPUT Score
ENDWHILE
IF Count > 0 THEN
Average ← Total / Count
OUTPUT "Class Average: ", Average
ELSE
OUTPUT "No scores entered"
ENDIF
5. Common Examiner Traps: Missing Arrowheads & Unlabelled Branches
- Unlabelled Decision Branches: Every decision diamond must have both lines clearly labelled ("Yes" / "No" or "True" / "False"). In converting to code, ensure the condition in your
IForWHILEmatches the "Yes" branch logically! - Missing Arrowheads: Without directional arrowheads on loop return lines, examiners cannot verify whether execution flows backwards or dead-ends, resulting in 0 marks for algorithm control flow.
- Confusing Input/Output with Process: Writing
Total ← Total + 1in a slanted parallelogram orINPUT Scorein a rectangle will cost a full mark. Always check symbol shapes!
6. Frequently Asked Questions: Flowchart to Pseudocode Conversion
How do I know what variables to declare when converting a flowchart?
Inspect every Parallelogram (INPUT/OUTPUT) and Rectangle (Process). List every identifier used on the left of an arrow (Total ← 0) or as an input target (INPUT Score). In Cambridge pseudocode, declare them at the top with their types (e.g. DECLARE Total : INTEGER).
Can PseudoStudio convert my pseudocode into a flowchart automatically?
Yes! Our Interactive Flowchart Maker parses Cambridge pseudocode and generates fully editable SVG flowchart diagrams with automatic node alignment and PNG export.
Do Cambridge examiners prefer pseudocode or flowcharts?
Paper 2 questions specify which representation to provide. Typically, questions 1 through 5 test both representation formats, while the 15-mark scenario question generally allows pseudocode or program code.
What is the difference between a flowchart process box and a subroutine box?
A standard process box is a simple rectangle for local calculations (e.g. x ← x + 1). A subroutine box has vertical double-bars on both sides, indicating a call to an external procedure (e.g. CALL SortArray()).
Practice Flowchart Past Paper Questions Online
Test your understanding with Cambridge IGCSE and A-Level past paper questions, dry-run trace tables, and instant AI grading.