Worked solution from the Algorithm Design and Problem-solving Paper 2 Problem-solving and Programming booklet, Part 2 of 2.
Fill the five empty shapes like this:
First box (after START): set Tries to 0 and Count to 0 [1]
Box under INPUT A, B: set Tries to Tries + 1 [1]
Decision: is A > B? If Yes, the next box is: set Count to Count + 1; if No, go back to the input [1]
Decision: is Count = 10? Label the branches Yes and No; No goes back to the input [1]
Output parallelogram (Yes branch): OUTPUT Tries [1]
ThisSequence is a string (for example "67,72") that is input in one go [1]
A special separator character (such as a comma) goes between the numbers, so the program can find it and split the string to pull out each number (or every number has a fixed length) [1]
▶ Starts at Q2 (13:56)
Starts at Q2 (13:56) · 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.