Question 7(a)(i) 2013 · May-June · Paper 32 · 1 mark
Reveal official mark-scheme answer
Official answer for Question 7
Part (a)
(i)
Part (a)
(i)
2
Show text version of question
Question 7
Part (a)
(i)
Examiner's Use
FUNCTION CountCharacter(ThisArray : CHAR, UBound : INTEGER, ThisCharacter : CHAR) RETURNS INTEGER
The function checks each element in the array ThisArray with upper bound UBound. The function returns the number of times ThisCharacter appears in ThisArray. If the function is incorrectly formed it will give a ‘COMPILE ERROR’.
The function is used with the three arrays shown below:
Subscript/Index Identifier 1 2 3 4 5 6 7 8 9 10
City1 L O N D O N
City2 N E W <Space> Y O R K
City3 S T O C K H O L M
What is returned by the following function calls?
(i)
CountCharacter(City1, 6, ‘O’)
Why this question appears here
98% 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 9691_s13_qp_32.pdf
