Analyze an algorithm presented as pseudocode.


Teaching Note:

Examination questions may involve variables, calculations, simple and nested loops, simple conditionals and multiple or nested conditionals.

This would include tracing an algorithm as well as assessing its correctness.

MYP Mathematics: using flow charts to solve problems in real-life contexts, patterns and sequences, logic, algorithms.

MYP Technology: design cycle (inputs, processes, outputs, feedback, iteration).


Sample Question:


JSR Notes:

So this is the same idea as 4.2.4, only instead of analysing flow charts, you are analysing pseudocode.

The best way to do this is to look at past papers, including the former curriculum. There is always at least one question like this in Paper 1.

And as mentioned in the Teaching Note, you will almost always be asked to trace and to find an error and offer a solution.

For example, in the Sample Paper 1 2014, it's question # 8. Here it is:

From Sample Paper 1 - 2014:

pseudo code sample question 1


And a couple more examples.

pseudo code sample 2

pseudocode question 3