Past-paper question · 2016 May-June · Paper 22 · Q6(b)

Question 6(b) 2016 · May-June · Paper 22 · 6 marks

Original past-paper question for 6(B)
Original past-paper question for 6(B)
Original past-paper question for 6(B)
Original past-paper question for 6(B)
Original past-paper question for 6(B)
Original past-paper question for 6(B)
Reveal official mark-scheme answer

The answer for this question is in the official mark scheme: open the mark scheme.

Mark scheme 9608_s16_ms_22.pdf →

Show text version of question

Question 6

Part (b)

Part (b)

Write the pseudocode equivalent of the structured English. Use the identifiers from the table

in part (a). ................................................................................................................................................... ................................................................................................................................................... ................................................................................................................................................... ................................................................................................................................................... ................................................................................................................................................... ................................................................................................................................................... ................................................................................................................................................... ................................................................................................................................................... ................................................................................................................................................... ................................................................................................................................................... ................................................................................................................................................... ................................................................................................................................................... ................................................................................................................................................... ...............................................................................................................................................[6]

Question 6

Question 3 begins on page 7.

Question 7

Question 3

A
string encryption function is needed. The encryption uses a simple character-substitution method.

In this method, a new character substitutes for each character in the original string. This will create the encrypted string. The substitution uses the 7-bit ASCII value for each character. This value is used as an index for a 1D array, Lookup, which contains the substitute characters. Lookup contains an entry for each of the ASCII characters. It may be assumed that the original string and the substitute characters are all printable. For example: • ‘A’ has ASCII value 65 • Array element with index 65 contains the character ‘Y’ (the substitute character) • Therefore, ‘Y’ substitutes for ‘A’ • There is a different substitute character for every ASCII value The programmer writes a function, EncryptString, to return the encrypted string. This function will receive two parameters, the original, PlainText string and the 1D array.

Topic relevance

Why this question appears here

71% assigned-topic match · Data types and structures › Arrays

Topic-match percentages estimate how closely each question fits the selected syllabus topic. They are a guide for choosing stricter or broader practice.

Permanent source page: Educate A Change · From 9608_s16_qp_22.pdf

Keep practising this topic