Same steps, new shape.

Six original Cambridge-style questions on documenting and converting algorithms, with mark-scheme style answers.

Original questions All questions on this page are original work, written in the Cambridge AS & A Level style. They are not from past papers. They test the same concepts and skills the syllabus rewards.
Keep these straight

Match the shapes.

01
Recall
[2 marks]

Explain what is meant by an algorithm.

  • A solution to a problem / a way of carrying out a task. ✓
  • Expressed as a (finite) sequence of defined steps. ✓
02
Apply
[3 marks]

A program inputs a student's name and the number of hours they studied on each of 5 days, and outputs their name with the total hours. Complete an identifier table for three of the identifiers it needs.

  • StudentName : STRING, the name input. ✓
  • Hours : REAL (or INTEGER), hours studied on one day. ✓
  • TotalHours : REAL, sum of the hours for the 5 days (also accept Day : INTEGER, loop counter 1 to 5). ✓
03
Trace
[3 marks]

The algorithm in Fig. 1 is run with the inputs 8, 15, 4, 9, -1. State the final values of Total and Count and the output.

  • Total = 8 + 15 + 4 + 9 = 36. ✓
  • Count = 4 (the rogue value -1 is not added or counted). ✓
  • Output 36 / 4 = 9 (a REAL, 9.0). ✓
04
Write
[5 marks]

Write pseudocode from this structured English description:

1. SET Highest to 0
2. REPEAT the next two steps 10 times
3. INPUT a score
4. IF the score is greater than Highest, SET Highest to the score
5. OUTPUT Highest

  • Highest ← 0 before the loop. ✓
  • FOR Index ← 1 TO 10 ... NEXT Index. ✓
  • INPUT Score inside the loop. ✓
  • IF Score > Highest THEN Highest ← Score ENDIF inside the loop. ✓
  • OUTPUT Highest after the loop. ✓
05
Explain
[3 marks]

Describe how the pseudocode WHILE Number > 9 ... ENDWHILE would be drawn as part of a flowchart.

  • A decision symbol (diamond) containing Number > 9? placed before the loop body. ✓
  • The Yes / True exit leads to the process box(es) of the body, and a flow line returns from the end of the body to the decision. ✓
  • The No / False exit leads to the step after the loop; both exits are labelled. ✓
06
Analysis
[3 marks]

Give one advantage of each method of documenting an algorithm: (a) structured English; (b) a flowchart; (c) pseudocode.

  • (a) Structured English: easy for a non-programmer / the client to read and agree. ✓
  • (b) Flowchart: shows the flow of control and loops visually, so the paths are easy to follow. ✓
  • (c) Pseudocode: close to program code, so it is quick to convert into a programming language, but is not tied to one language. ✓

Mark this once you have attempted all six and checked your working. It records a Practiced badge on the topic and adds a one-time bonus. Revealing the solutions alone does not count.