Question 3(d)(iii) 2012 · May-June · Paper 22 · 18 marks
Question 3
Part (d)
(iii)
Question 3
Question 6
2 Philipe is trying different ways of designing the process of entering data into an array. For He declares a variable called ArraySize and sets it to 3. Examiner's Use He declares an array Number[ArraySize].
He then writes the following pseudocode.
Element ← 1 WHILE Element < ArraySize DO INPUT Number[Element] Element ← Element + 1 ENDWHILE Philipe wants to increase the size of the array to 500. This is too large to check with a trace table. Describe how you would check that the logic of the pseudocode is correct for 500 iterations.
Question 8
3 Gina is developing her programming skills in string handling. For She is going to input two strings. Examiner's Use Each string is made up of three parts:
- letters, followed by
- a single ‘*’ character, followed by
- letters
The groups of letters after the ‘*’ characters are joined together to form a new string which is then output.
For example, with “DFG*COM” and “B*PUTER” as inputs, the new string output will be “COMPUTER”.
Part (a)
Using a high-level programming language, write the code to perform this task. (Ensure
that you use meaningful variable names and lay the code out clearly.)
Programming language
Code
Question 9
Part (b)
She writes this code as the function JoinStrings because it is to be used several For
times. Examiner's Use
(iii)
State why Gina used a function rather than a procedure.
Reveal official mark-scheme answer
The answer for this question is in the official mark scheme: open the mark scheme.
Why this question appears here
71% assigned-topic match · Programming › Structured programming
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 9691_s12_qp_22.pdf
