Question 3(d)(i) 2012 · May-June · Paper 21 · 19 marks
Question 3
Part (d)
(i)
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
(i)
State the parameters of the function.
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
82% assigned-topic match · Programming › Programming basics
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_21.pdf
