Past-paper question · 2013 May-June · Paper 31 · Q7(a)(ii)

Question 7(a)(ii) 2013 · May-June · Paper 31 · 1 mark

Original past-paper question for 7(A)(II)
Original past-paper question for 7(A)(II)
Reveal official mark-scheme answer Official mark-scheme answer for 7(A)(II)

Official answer for Question 7

Part (a)

(ii)

(ii)

COMPILE ERROR // reporting an error

[1]

Mark scheme 9691_s13_ms_31.pdf →

Show text version of question

Question 7

Part (a)

(ii)

A
user-defined function CountCharacter is defined, using pseudocode, as follows: For

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?

(ii)

CountCharacter(City2, ‘R’, 8)

[1]
Topic relevance

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_31.pdf

Keep practising this topic