Question 4(a) 2019 · October-November · Paper 21 · 4 marks
Reveal official mark-scheme answer
Official answer for Question 4
Part (a)
Question 4
- Stepwise Refinement / Top-down design
- Check that character is between 'A' and 'Z'
- Produce unique array index for this character
- Increment this array element
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 ....................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Question 9
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
