Past-paper question · 2019 October-November · Paper 22 · Q3(a)

Question 3(a) 2019 · October-November · Paper 22 · 3 marks

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

Official answer for Question 3

Part (a)

✓
DECLARE Result : ARRAY [0:9] OF INTEGER

Question 3

✓
DECLARE Index : INTEGER
✓
FOR Index ← 0 TO 9
✓
Result[Index] ← 0
✓
ENDFOR
✓
One mark for each of the following:
✓
1.
✓
Declaration of RESULT array (10 elements of type INTEGER)
✓
2.
✓
Loop
✓
3.
✓
Assignment within a loop

Mark scheme 9608_w19_ms_22.pdf →

Show text version of question

Question 3

Part (a)

Question 3

A student is developing a program to search through a string of numeric digits to count how many

times each digit occurs. The variable InString will store the string and the 1D array Result will store the count values.

The program will:

  • check each character in the string to count how many times each digit occurs
  • record the count for each digit using the array
  • output the count for each element of the array together with the corresponding digit.

Part (a)

The array Result is a 1D array of type INTEGER.

Write pseudocode to declare the array and to initialise all elements to zero.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

.............................................................................................................................................

[3]

Question 7

Topic relevance

Why this question appears here

72% assigned-topic match · Data types and structures › Data types and records

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

Keep practising this topic