Skip to main content
QLDDigital SolutionsSyllabus dot point

How are algorithms designed, represented and traced to solve real-world problems?

Represent algorithms using pseudocode and structured English, applying sequence, selection and iteration, and trace them with a desk check to verify correctness before coding

A focused answer to the QCE Digital Solutions Unit 3 dot point on algorithm design. Pseudocode conventions, the three control structures (sequence, selection, iteration), how to desk check a trace table, and how QCAA expects algorithms presented in IA1 technical proposals.

Generated by Claude Opus 4.76 min answer

Reviewed by: AI editorial process; not yet individually human-reviewed

Have a quick question? Jump to the Q&A page

Jump to a section
  1. What this dot point is asking
  2. The three control structures
  3. Iteration
  4. Desk checking with a trace table
  5. Algorithm quality
  6. Common patterns to memorise
  7. How this appears in IA1

What this dot point is asking

QCAA wants you to express a solution as an algorithm: an ordered, finite, unambiguous set of steps that always terminates. You must use pseudocode or structured English with the three control structures (sequence, selection, iteration), and verify it with a desk check before writing real code. In IA1 the technical proposal is judged partly on whether your algorithms are correct, readable and clearly mapped to the requirements.

The three control structures

Every algorithm, no matter how large, is built from three constructs:

  • Sequence: steps run top to bottom, one after another.
  • Selection: a decision chooses between paths (IF, IF/ELSE, CASE).
  • Iteration: a block repeats (pre-test WHILE, post-test REPEAT/UNTIL, count-controlled FOR).

Pseudocode is language-neutral. QCAA accepts any consistent style; what matters is that indentation shows nesting and keywords are capitalised.

BEGIN GradeClassifier
    INPUT mark
    IF mark >= 85 THEN
        SET grade TO "A"
    ELSE IF mark >= 70 THEN
        SET grade TO "B"
    ELSE IF mark >= 50 THEN
        SET grade TO "C"
    ELSE
        SET grade TO "Fail"
    END IF
    OUTPUT grade
END GradeClassifier

Iteration

A pre-test loop checks the condition before the body, so it can run zero times. A count-controlled loop runs a known number of times.

BEGIN SumEvens
    SET total TO 0
    FOR n FROM 1 TO 10 DO
        IF n MOD 2 = 0 THEN
            SET total TO total + n
        END IF
    END FOR
    OUTPUT total            // 2+4+6+8+10 = 30
END SumEvens

MOD returns the remainder, so n MOD 2 = 0 is the standard even-number test. Choosing the wrong loop type (or the wrong boundary) is the most common logic error, which is exactly what a desk check catches.

Desk checking with a trace table

A desk check is a manual walkthrough. You build a trace table with one column per variable and one row per executed line, then step through the algorithm by hand, updating values exactly as the computer would. This proves correctness without running code.

Algorithm quality

QCAA marks algorithms on more than "does it run". A strong IA1 algorithm:

  • maps clearly to a stated functional requirement;
  • uses meaningful identifiers (runningTotal, not x);
  • handles edge cases (empty input, zero, boundary values);
  • is efficient enough for the data size (avoid an unnecessary nested loop where a single pass works).

You should also state the algorithm's purpose, its inputs, its outputs and any pre-conditions, because the technical proposal is a communication document as much as a design.

Common patterns to memorise

  • Accumulator: initialise a total to 0, add inside a loop.
  • Counter: initialise a count to 0, increment when a condition holds.
  • Flag: a Boolean that records whether something happened (found ← FALSE).
  • Min/max: seed with the first value, then compare each subsequent value.

These four patterns cover most Unit 3 algorithm questions, so practise writing and tracing each from memory.

How this appears in IA1

The IA1 technical proposal asks you to design algorithms for the prescribed problem and justify them. Markers reward algorithms that are traceable, that reference the requirements, and that come with a desk check or test data showing the logic is sound. Present pseudocode in a monospaced block with consistent indentation, and pair each algorithm with a short trace or test table so the marker can see your reasoning, not just your result.

Exam-style practice questions

Practice questions written in the style of QCAA exam questions on this dot point, with worked answer explainers. The year tag is the paper they imitate, not the source.

2021 QCAA8 marksA friend is interested in learning more about encryption. Use pseudocode to symbolise a simple Caesar cipher as a demonstration.
Show worked answer →

For 8 marks the marking guide rewards a complete, logically correct algorithm that uses pseudocode conventions, so structure it as input, then iteration, then a return.

A high band response symbolises:

  1. INPUT for the plain-text string [1 mark].
  2. INPUT for the key or shift integer [1 mark].
  3. A declarative statement that sets the alphabet, e.g. SET alphabet TO "ABCDEFGHIJKLMNOPQRSTUVWXYZ" [1 mark].
  4. A FOR loop that traverses the plain text one character at a time [1 mark].
  5. Inside the loop, a statement that shifts each character by the key to build the cipher text [1 mark].
  6. A RETURN (or OUTPUT) for the encrypted text [1 mark].
  7. An algorithm with no logic errors [1 mark].
  8. Effective use of pseudocode conventions, capitalised keywords and consistent indentation [1 mark].

The shift is the core: for each character, take its position in the alphabet, add the key, wrap with MOD 26, and append the new letter. Markers reward a traceable loop, not perfect syntax.

2024 QCAA8 marksAn esports club stores player data in JSON. For each player the club wants to display the gamer tag, their age, and the percentage of games won. Each record holds name, gamerTag, dateOfBirth, gamesPlayed and gamesWon. Use pseudocode to symbolise the algorithmic statements needed to display the required data.
Show worked answer →

This is a sequence-inside-iteration problem worth 8 marks. The marking guide awards one mark each for the statements below, plus one for pseudocode conventions.

  1. Retrieving the JSON data, e.g. READ the file into a player array [1 mark].
  2. Looping through every record, e.g. FOR count = 0 TO playerArray.length [1 mark].
  3. Calculating age by splitting dateOfBirth into day, month and year and subtracting from the current date, decrementing if the birthday has not yet occurred this year [1 mark].
  4. Calculating percentage won as gamesWon / gamesPlayed * 100 [1 mark].
  5. Displaying the gamer tag [1 mark].
  6. Displaying the calculated age [1 mark].
  7. Displaying the percentage won [1 mark].
  8. Effective use of pseudocode conventions [1 mark].

Markers reward getting the current day, month and year before the loop so the age calculation is correct, and an algorithm free of logic errors.

2023 QCAA9 marksA one-time pad algorithm encrypts an 8 character word and uses 0 as the first array index. There are four errors on lines 9 to 21 inclusive (the outer loop reads FOR i = 0 to 9; the inner loop compares plainText[j] to alphabet[i]; cipherText[i] = alphabet(alphabetLocation + key[i]) mod 26; and OUTPUT cipherText[i] sits outside the loop). Use pseudocode to correct the four errors on lines 9 to 21. Justify your response.
Show worked answer →

This is a tracing and debugging task: desk check the loop bounds and indexing, then correct each fault and justify it. For 9 marks each correction with justification is rewarded.

  1. Line 9: the outer loop should iterate the 8 character word, so FOR i = 0 TO 7 (not TO 9), because indices run 0 to 7 for eight characters.
  2. Lines 11 to 12: to find the plain-text letter, the comparison should be alphabet[j] against plainText[i], because the inner loop searches the 26 letter alphabet for the current plain-text character, so swap the indices.
  3. Line 18: alphabet is an array, so index it with square brackets, cipherText[i] = alphabet[(alphabetLocation + key[i]) mod 26].
  4. Line 21: OUTPUT cipherText[i] must move inside the FOR loop (or output the whole array after it), otherwise only the last character prints.

Justify each fix by tracing one character through the corrected loop to show the cipher index is computed and stored for every letter.