Note AcademyNote Academy

Computer Science · May / June 2025 · Paper 22 · Question 6

0478

As printed in the paper

The question as text

This pseudocode is an algorithm. ˜™š›œ™ ½¦ˆ® ž ¥¨«ƒ¬ ˜™š›œ™ ¾— ž «ƒ¨™¬™ ˜™š›œ™ ¾£ ž «ƒ¨™¬™ ˜™š›œ™ ƒ„ †‡ˆ ž «ƒ¨™¬™ ˜™š›œ™ «ª®‡¯ ž «ƒ¨™¬™ ˜™š›œ™ ›— ž šœ ˜™š›œ™ ›£ ž šœ ˜™š›œ™ š¦ª”‘ª„‡ ž ¿¡¡›™œƒ «ƒ³´¨ ƒ„ †‡ˆ ¢¡ «ª®‡¯ — ¨¡ ƒ„ †‡ˆ «ƒ³´¨ ½¦ˆ® š¦ª”‘ª„‡ ¨´™ ¾— — ¾£ ›™ƒ¬¨À½¦ˆ®Á ½«›™ š¦ª”‘ª„‡  ¨´™ œƒ˜ ¾— ¶ ¾£ ˜¡ ›— ¥´¿¥¨«ƒ¬À½¦ˆ®¹ ¾—¹ —Á ›£ ¥´¿¥¨«ƒ¬À½¦ˆ®¹ ¾£¹ —Á «¢ ›— ¶Ã ›£ ¨™ƒ š¦ª”‘ª„‡ ¢œ›¥™ ™›¥™ ¾— ¾— µ — ¾£ ¾£ Ä — ™ƒ˜«¢ ™ƒ˜½«›™ «¢ š¦ª”‘ª„‡  ¨´™ ¨™ƒ ¡´¨³´¨ ¸¥„Å҉‰Æ„©¸ ™›¥™ ¡´¨³´¨ ¸ƒ¡¨ ‰„Å҉‰Æ„©¸ ™ƒ˜«¢ ƒ™·¨ «ª®‡¯

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

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

    One mark per mark point

    MP1 Correct Number and Index columns

    MP2 Correct Word column

    MP3 Correct Continue column

    MP4 Correct V1 and V2 column

    MP5 Correct L1 and L2 column

    MP6 Correct OUTPUT column

    Number Index

    Word

    Continue V1 V2 L1 L2

    OUTPUT 2

    1

    RACECAR

    TRUE

    1

    7

    R

    R

    2

    6

    A

    A

    3

    5

    C

    C

    4

    4

    Successful 2

    TREAT

    TRUE

    1

    5

    T

    T

    2

    4

    R

    A

    FALSE

    NOT successful

  • 6(b)[1]

    Finds words that read the same forwards and backwards.

  • 6(c)[3]

    One mark per mark point, max three

    MP1 Uses an index to mark the start and end of each word // uses V1 to mark the start of the word and V2 to mark the end

    MP2 After each check, these are moved to the next character in the word at each end of the word // V1 is incremented by 1 and V2 is decremented by 1 after each check.

    MP3 When the two indexes match or cross, the whole word has been checked // When V1 = V2 or V1 > V2, the whole word has been checked

    MP4 The algorithm will exit if it is found that two compared letters are not the same.

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