Worked solution from the System Software Paper 3 Advanced Theory booklet, Part 2 of 2.
Turn each operator into brackets in order.
5 2 + becomes (5 + 2); 9 3 - becomes (9 - 3). [1]
Then / joins them: (5 + 2) / (9 - 3). [1]
Then * 3: ((5 + 2) / (9 - 3)) * 3 [1]
Do the brackets first, then the operator that joins them.
(7 + 3) becomes 7 3 + [1]
(2 * 8) becomes 2 8 *, then - and 6 /: 7 3 + 2 8 * - 6 / [1]
a = 17, b = 5, c = 7, d = 3, e = 10.
| Item read | Stack (bottom → top) |
|---|---|
| a | 17 |
| b | 17, 5 |
| - | 12 |
| c | 12, 7 |
| d | 12, 7, 3 |
| + | 12, 10 |
| * | 120 |
| e | 120, 10 |
| / | 12 |
17 and 5 pushed, then 12 after - [1]
7 and 3 pushed, then 10 after + [1]
120 after * [1]
10 pushed, then final answer 12 after / [1]
Marks are given for correct stack stages like these.
▶ Starts at Q5 (30:16)
Starts at Q5 (30:16) · by Pseudocode Pro. Tap the picture to open it on YouTube.
Solutions follow the official Cambridge mark schemes; marks are shown in grey. Videos are from other YouTube channels. Paper codes read component / series / year: M/J = May/June, O/N = October/November. Past-paper questions © UCLES, reproduced for classroom practice.