Past-paper question · 2019 October-November · Paper 21 · Q4(a)

Question 4(a) 2019 · October-November · Paper 21 · 4 marks

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

Official answer for Question 4

Part (a)

✓
One mark for process name, max 3 for structured English.

Question 4

✓
Process:
  • Stepwise Refinement / Top-down design
✓
Structured English:
  • Check that character is between 'A' and 'Z'
  • Produce unique array index for this character
  • Increment this array element

Mark scheme 9608_w19_ms_21.pdf →

Show text version of question

Question 4

Part (a)

Question 4

A student is developing a program to count how many times each character of the alphabet (A to Z)

occurs in a given string. Upper case and lower case characters will be counted as the same. The string may contain non-alphabetic characters, which should be ignored.

The program will:

  • check each character in the string to count how many times each alphabetic character occurs
  • store the count for each alphabetic character in a 1D array
  • output each count together with the corresponding character.

Part (a)

The student has written a structured English description of the algorithm:

1. START at the beginning of the string 2. SELECT a character from the string 3. CONVERT the character to upper case 4. CHECK whether the character is alphabetic and INCREMENT as required. 5. REPEAT from step 2 until last character has been checked 6. OUTPUT a suitable message giving the count of each alphabetic character

Step 4 above is not described in sufficient detail.

The student decides to apply a process to increase the level of detail given in step 4.

State the name of the process and use this process to write step 4 in more detail. Use structured English for your answer.

Process .....................................................................................................................................

Structured English ....................................................................................................................

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

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

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

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

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

[4]

Question 9

Topic relevance

Why this question appears here

82% assigned-topic match · Programming › Constructs

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

Keep practising this topic