Blame
|
1 | > **DRAFT** — under teacher review. |
||||||
| 2 | ||||||||
| 3 | # VCAA Pseudocode — Write Structured English, Not Python |
|||||||
| 4 | ||||||||
| 5 | The Hamilton and Alexandra College · Year 12 · 2026 |
|||||||
| 6 | ||||||||
| 7 | If you can already code in Python, pseudocode feels like a step backwards — why write `count ← 5` when `count = 5` is right there? The answer: VCAA assessors are checking whether you can express an algorithm clearly and independently of any language. Python-flavoured pseudocode loses marks. This page maps every construct you need. |
|||||||
| 8 | ||||||||
| 9 | --- |
|||||||
| 10 | ||||||||
|
11 | ## 🎬 What is pseudocode? |
||||||
|
12 | |||||||
|
13 | **🎯 Watch for:** the core idea — pseudocode describes *what the algorithm does* in plain, structured steps, without committing to any one programming language. |
||||||
| 14 | ||||||||
| 15 | {{Video|src=https://www.youtube.com/watch?v=wKe31Xi2Ck8}} |
|||||||
|
16 | |||||||
|
17 | **✍️ While you watch:** write down the one sentence that best explains *why* we bother with pseudocode instead of going straight to code. |
||||||
|
18 | |||||||
| 19 | --- |
|||||||
| 20 | ||||||||
| 21 | ## The two rules that actually matter |
|||||||
| 22 | ||||||||
| 23 | Before the big table, pin these two rules — they matter more than any single symbol: |
|||||||
| 24 | ||||||||
| 25 | 1. **Be consistent.** If you open a block with `BEGIN`, close it with `END` throughout. If you use `WHILE … ENDWHILE`, don't switch to `WHILE … END_WHILE` two lines later. |
|||||||
| 26 | ||||||||
| 27 | 2. **Write at a clear high level.** You do not need to encode every trivial detail. "Load `data.csv` into an array of records" is perfectly acceptable pseudocode when it is self-explanatory. |
|||||||
| 28 | ||||||||
| 29 | --- |
|||||||
| 30 | ||||||||
| 31 | ## Pseudocode ↔ Python comparison |
|||||||
| 32 | ||||||||
| 33 | ### Program structure and basics |
|||||||
| 34 | ||||||||
| 35 | | Pseudocode | Python | Notes | |
|||||||
| 36 | |---|---|---| |
|||||||
| 37 | | `START` … `STOP` or `BEGIN` … `END` | *(not required)* | Brackets a whole program or subprogram. Pick one style and stick to it. | |
|||||||
| 38 | | `count ← 5` | `count = 5` | Assignment uses a **left-arrow `←`**, not `=` or `:=`. | |
|||||||
| 39 | | `// comment` or `# comment` | `# comment` | Comments work in pseudocode too — use them. | |
|||||||
| 40 | ||||||||
| 41 | ### Selection |
|||||||
| 42 | ||||||||
| 43 | | Pseudocode | Python | Notes | |
|||||||
| 44 | |---|---|---| |
|||||||
| 45 | | `IF condition THEN`<br> `action_1`<br>`ELSE`<br> `action_2`<br>`ENDIF` | `if condition:`<br> `action_1`<br>`else:`<br> `action_2` | Must close with `ENDIF`. Chained: use `ELSE IF … THEN`. | |
|||||||
| 46 | | `CASE OF variable`<br> `value1: action_1`<br> `value2 TO value3: action_2`<br> `OTHERWISE action_3`<br>`ENDCASE` | `if variable == value1:`<br> `action_1`<br>`elif value2 <= variable <= value3:`<br> `action_2`<br>`else:`<br> `action_3` | CASE has no direct Python equivalent; use it when there are many branches. | |
|||||||
| 47 | ||||||||
| 48 | ### Iteration |
|||||||
| 49 | ||||||||
| 50 | | Pseudocode | Python | Notes | |
|||||||
| 51 | |---|---|---| |
|||||||
| 52 | | `WHILE condition DO`<br> `action_1`<br>`ENDWHILE` | `while condition:`<br> `action_1` | Pre-test loop. Must close with `ENDWHILE`. | |
|||||||
| 53 | | `REPEAT`<br> `action_1`<br>`UNTIL condition` | `while True:`<br> `action_1`<br> `if condition: break` | Post-test loop — body always runs at least once. | |
|||||||
| 54 | | `FOR count ← a TO b STEP 1`<br> `action_1`<br>`ENDFOR` | `for count in range(a, b+1, 1):`<br> `action_1` | Count-controlled. Must close with `ENDFOR`. | |
|||||||
| 55 | | `FOREACH item IN seq`<br> `action_1`<br>`NEXT item` | `for item in seq:`<br> `action_1` | Iterates over a sequence. Close with `NEXT item`. | |
|||||||
| 56 | ||||||||
| 57 | ### Operators |
|||||||
| 58 | ||||||||
| 59 | | Pseudocode | Python | Notes | |
|||||||
| 60 | |---|---|---| |
|||||||
| 61 | | `=` | `==` | **Equality test** in pseudocode is `=`, not `==`. | |
|||||||
| 62 | | `<>` | `!=` | **Not-equals** in pseudocode is `<>`. Never use `!=` in pseudocode. | |
|||||||
| 63 | | `>, <, <=, >=` | `>, <, <=, >=` | Same symbols in both. | |
|||||||
| 64 | | `AND, OR, NOT` | `and, or, not` | Uppercase in pseudocode. | |
|||||||
| 65 | | `+, -, *, /, ^` | `+, -, *, /, **` | Pseudocode uses `^` for exponentiation; Python uses `**`. | |
|||||||
| 66 | | `MOD` or `%` | `%` | Integer remainder. | |
|||||||
| 67 | | `DIV` | `//` | Integer division. | |
|||||||
| 68 | ||||||||
| 69 | ### Subprograms (methods / functions / procedures) |
|||||||
| 70 | ||||||||
| 71 | | Pseudocode | Python | Notes | |
|||||||
| 72 | |---|---|---| |
|||||||
| 73 | | `BEGIN fun(arg1, arg2)`<br> `action_1`<br> `RETURN expression`<br>`END` | `def fun(arg1, arg2):`<br> `action_1`<br> `return expression` | `BEGIN`/`END` bracket the subprogram. `RETURN` ends a function; omit it for a procedure. | |
|||||||
| 74 | ||||||||
| 75 | --- |
|||||||
| 76 | ||||||||
|
77 | ## Worked example 1 — a method inside a class |
||||||
|
78 | |||||||
| 79 | This is the Level-9 OOP pseudocode skill. You are writing a method, not a standalone program, so you use `BEGIN`/`END` rather than `START`/`STOP`. |
|||||||
| 80 | ||||||||
| 81 | **Scenario:** a `ScoreTracker` class has a method `is_passing` that returns whether a student's average score meets a threshold. |
|||||||
| 82 | ||||||||
| 83 | ``` |
|||||||
| 84 | BEGIN is_passing(scores, threshold) |
|||||||
| 85 | total ← 0 |
|||||||
| 86 | FOREACH score IN scores |
|||||||
| 87 | total ← total + score |
|||||||
| 88 | NEXT score |
|||||||
| 89 | average ← total / length(scores) |
|||||||
| 90 | IF average >= threshold THEN |
|||||||
| 91 | RETURN True |
|||||||
| 92 | ELSE |
|||||||
| 93 | RETURN False |
|||||||
| 94 | ENDIF |
|||||||
| 95 | END |
|||||||
| 96 | ``` |
|||||||
| 97 | ||||||||
| 98 | Notice: |
|||||||
| 99 | - Assignment is `←` throughout — never `=` or `==`. |
|||||||
| 100 | - Not-equals would be `<>` if needed (e.g. `IF count <> 0 THEN`). |
|||||||
| 101 | - `FOREACH … NEXT item` closes the loop. |
|||||||
| 102 | - `IF … THEN … ELSE … ENDIF` closes the selection. |
|||||||
| 103 | - Indentation is consistent. |
|||||||
| 104 | ||||||||
| 105 | > [!TIP] |
|||||||
| 106 | > You do not need to write out every getter and setter in full. If a step is clear — "retrieve the current user record from the database" — that single line is enough. Save detailed pseudocode for the logic that actually matters in your design. |
|||||||
| 107 | ||||||||
| 108 | --- |
|||||||
| 109 | ||||||||
|
110 | ## Worked example 2 — one algorithm, any machine |
||||||
| 111 | ||||||||
| 112 | Pseudocode's superpower is that it is **language- and machine-independent**. Here is a complete algorithm — the **wall-follower**, or *right-hand rule*, for escaping a maze — written once and able to run anywhere: in your head, in a software simulation, or on a Lego robot. |
|||||||
| 113 | ||||||||
| 114 | The rule is simple: **keep your right hand on the wall and never lift it.** In any maze whose walls are all connected, following it will always bring you to the exit. |
|||||||
| 115 | ||||||||
| 116 |  |
|||||||
| 117 | ||||||||
| 118 | *Trace it yourself: start at the top-left entrance and keep your right hand on the wall. Where do you come out? (Background reading: [Wikipedia — Maze-solving algorithm](https://en.wikipedia.org/wiki/Maze-solving_algorithm).)* |
|||||||
| 119 | ||||||||
| 120 | The same idea in VCAA pseudocode: |
|||||||
| 121 | ||||||||
| 122 | ``` |
|||||||
| 123 | START at the maze entrance |
|||||||
| 124 | ||||||||
| 125 | WHILE not at the exit DO |
|||||||
| 126 | IF the right-hand side is open THEN |
|||||||
| 127 | // an opening — follow the wall around the corner |
|||||||
| 128 | turn right |
|||||||
| 129 | step forward |
|||||||
| 130 | ELSE IF the way ahead is clear THEN |
|||||||
| 131 | // keep moving, right hand sliding along the wall |
|||||||
| 132 | step forward |
|||||||
| 133 | ELSE IF only the left is open THEN |
|||||||
| 134 | // wall ahead and on the right |
|||||||
| 135 | turn left |
|||||||
| 136 | step forward |
|||||||
| 137 | ELSE |
|||||||
| 138 | // dead end — walls on three sides |
|||||||
| 139 | turn around |
|||||||
| 140 | ENDIF |
|||||||
| 141 | ENDWHILE |
|||||||
| 142 | ||||||||
| 143 | OUTPUT "Hooray! I escaped the maze!" |
|||||||
| 144 | ``` |
|||||||
| 145 | ||||||||
| 146 | There is no Python and no Java here — nothing tied to one language. That is exactly what makes it pseudocode. |
|||||||
| 147 | ||||||||
| 148 | Now watch the *same rule* run on two completely different machines: |
|||||||
| 149 | ||||||||
| 150 | **🎯 Watch for:** the right-hand rule as a software simulation — the logic is identical to the pseudocode above. |
|||||||
| 151 | ||||||||
| 152 | {{Video|src=https://www.youtube.com/watch?v=mFOSd44_NfA}} |
|||||||
| 153 | ||||||||
| 154 | **🎯 Watch for:** the very same rule driving a physical Lego EV3 robot through a real maze — same algorithm, different machine. |
|||||||
| 155 | ||||||||
| 156 | {{Video|src=https://www.youtube.com/watch?v=AdOLnKFzBoM}} |
|||||||
| 157 | ||||||||
| 158 | > [!NOTE] |
|||||||
| 159 | > **Activity — why does the right-hand rule work?** Write two or three sentences. Hint: picture a wall that is connected to the outer boundary of the maze. If you trace its edge without ever letting go, can you ever get stuck in a loop — or must you eventually walk the whole of that wall, including the stretch that contains the exit? |
|||||||
| 160 | ||||||||
| 161 | --- |
|||||||
| 162 | ||||||||
|
163 | ## Common mistakes |
||||||
| 164 | ||||||||
| 165 | ### Mistake 1 — Using `=` or `==` for assignment |
|||||||
| 166 | ||||||||
| 167 | > ~~`count = 5`~~ or ~~`count == 5`~~ |
|||||||
| 168 | ||||||||
| 169 | Correct: `count ← 5`. The left-arrow shows data flowing *into* the variable. Using `=` is Python; using `==` is a comparison, not assignment. |
|||||||
| 170 | ||||||||
| 171 | ### Mistake 2 — Using `!=` for not-equals |
|||||||
| 172 | ||||||||
| 173 | > ~~`IF count != 0 THEN`~~ |
|||||||
| 174 | ||||||||
| 175 | Correct: `IF count <> 0 THEN`. The `!=` operator belongs only in Python code. |
|||||||
| 176 | ||||||||
| 177 | ### Mistake 3 — Python-only constructs leaking in |
|||||||
| 178 | ||||||||
| 179 | > ~~`for item in list:`~~ or ~~`elif`~~ or ~~`print(x)`~~ |
|||||||
| 180 | ||||||||
| 181 | Use `FOREACH item IN list … NEXT item`, `ELSE IF … THEN`, and `OUTPUT x` instead. |
|||||||
| 182 | ||||||||
| 183 | ### Mistake 4 — Forgetting closing keywords |
|||||||
| 184 | ||||||||
| 185 | Every block that opens must close. Missing `ENDIF`, `ENDWHILE`, `ENDFOR`, or `ENDCASE` is a consistency error. Markers notice immediately. |
|||||||
| 186 | ||||||||
| 187 | ### Mistake 5 — Inconsistent block keywords |
|||||||
| 188 | ||||||||
| 189 | > ~~Opening with `BEGIN` but closing with `STOP`~~ |
|||||||
| 190 | ||||||||
| 191 | Pick `BEGIN`/`END` or `START`/`STOP` and use it everywhere in the same document. |
|||||||
| 192 | ||||||||
| 193 | --- |
|||||||
| 194 | ||||||||
| 195 | ## Check Your Understanding |
|||||||
| 196 | ||||||||
| 197 | 1. Rewrite this Python line as valid VCAA pseudocode: `score = score + 1` |
|||||||
| 198 | ||||||||
| 199 | >| **Answer:** `score ← score + 1` — assignment uses `←`, not `=`. |
|||||||
| 200 | ||||||||
| 201 | 2. A classmate writes `IF x != 0 THEN … ENDIF`. Name the mistake and write the corrected line. |
|||||||
| 202 | ||||||||
| 203 | >| **Answer:** `!=` is Python syntax, not pseudocode. Correct: `IF x <> 0 THEN … ENDIF`. The not-equals operator in VCAA pseudocode is always `<>`. |
|||||||
| 204 | ||||||||
| 205 | 3. You have a `WHILE` loop and an `IF` statement nested inside it. List the two closing keywords you need and the order they must appear. |
|||||||
| 206 | ||||||||
| 207 | >| **Answer:** `ENDIF` closes the inner `IF` first, then `ENDWHILE` closes the outer loop. Inner blocks always close before outer blocks. |
|||||||
| 208 | ||||||||
| 209 | --- |
|||||||
| 210 | ||||||||
|
211 | ## Credits |
||||||
| 212 | ||||||||
| 213 | - Maze diagram — [Grufo](https://commons.wikimedia.org/wiki/User:Grufo), via Wikimedia Commons, licensed GPLv3. |
|||||||
| 214 | ||||||||
| 215 | --- |
|||||||
| 216 | ||||||||
|
217 | ## See also |
||||||
| 218 | ||||||||
|
219 | - [IPO Charts — Process Means Steps](/sd/C05/IPO%20Charts%20-%20Process%20Means%20Steps) — turn an IPO Process column into formal pseudocode |
||||||
|
220 | - [Object Descriptions and Class Diagrams](/sd/C05/Object%20Descriptions%20and%20Class%20Diagrams) — the methods you write pseudocode for come from here |
||||||
|
221 | - [C05 Resources](/sd/Resources/C05-Resources) |
||||||
| 222 | ||||||||
| 223 | --- |
|||||||
| 224 | ||||||||
| 225 | ← Back to [C05 Home](/sd/C05/C05-home) · [VCE Software Development Hub](/sd/VCE%20Software%20Development%20Hub) |
|||||||
