Note AcademyNote Academy

Computer Science · Oct / Nov 2025 · Paper 22 · Question 5

0478

As printed in the paper

The question as text

This flowchart represents an algorithm. š‘|}‘ 𑋤 š {y’‘£­z~¿˜® § ‰ ¬ š š€~˜ § Œ|{šy ¬ š z~• € ª œ ¬ š z~¿˜š€~˜†z~• €Š § z~¿˜ ¬ š z~¿˜š€~˜†z~• €Š § ¥¥ ¬ ¤Ÿ‘ z~¿˜ ‹Ÿ‘¤Ÿ‘ ¥z~¿˜ •ƒ˜¿ ·˜¦~˜¥ ‹Ÿ‘¤Ÿ‘ ¥z~¿˜š€~˜ ¦•””¥ ‹Ÿ‘¤Ÿ‘ ¥{˜ À€« –•ƒ€ ·˜ ‰¥ š€~˜ Œ|{šy š€~˜ ‘}Ÿy z~¿˜š€~˜†z~• €Š z~¿˜ z~• € z~• € © v z~• € v ~ ~ ~ ~ ˜ƒ ~ ˜ƒ ˜ƒ ˜ƒ ˜ƒ

Read automatically from the paper; the printed page above is exact.

Show the answer and mark scheme
  • 5(a)[6]

    One mark per mark point, max six

    MP1

    Correct Code column

    MP2

    Correct Store column

    MP3

    Correct Count column

    MP4

    First four CodeStore columns left unchanged

    MP5

    Correct CodeStore[5] and CodeStore[6] columns

    MP6

    Correct OUTPUT column

    CodeStore[]

    Code

    Store Count

    [1]

    [2]

    [3]

    [4]

    [5]

    [6]

    OUTPUT

    aBcd 1532 Face 63q8

    7686

    FALSE

    1

    2

    3

    4

    TRUE

    5

    7686

    6

    Face

    FALSE

    1

    2

    CodeStore[]

    Code

    Store

    Count

    [1]

    [2]

    [3] [4]

    [5]

    [6]

    OUTPUT

    3

    Code used before

    Speed

    Length must be 4

    432U

    FALSE

    1

    2

    3

    4

    5

    TRUE

    6

    432U

    7

    CodeStore full

  • 5(b)[3]

    One mark per mark point, max three

    MP1

    Checks that the length of the code input is 4 characters.

    MP2

    Checks the code against the array contents to see if it has been used before (in the last 6 codes) MP3

    If the code passes the tests, it is stored in the array

    MP4

    Stores the code in the lowest available index

    MP5

    Checks that the code store isn’t full before storing a new code // Outputs a code store is full message if appropriate // Algorithm continues until the code store is full.

  • 5(c)[4]

    One mark per mark point, max four

    MP1

    Declaration of array using correct name and data type

    MP2

    Declaration of loop counter

    MP3

    Use of appropriate loop for six iterations (allow any type of loop)

    MP4

    Assignment of all array elements to null string (using loop counter as array index)

    Example:

    DECLARE CodeStore : ARRAY[1:6] OF STRING

    DECLARE Index : INTEGER

    FOR Index ← 1 TO 6

    CodeStore[Index] ← ""

    NEXT Index

Make a free account to save your answers and see your weak topics and ask the AI why a wrong answer is wrong.