Skip to main content
A-LevelComputer ScienceProgramming9618/22 · May/June 2021 · Q813 Marks

A program is needed to take a string containing a full name and to produce a new string of initials. Some words in the full name will be ignored. For example, “the”, “and”, “of”, “for” and “to” may all be ignored. Each letter of the new string must be upper case. For example: Full name Initials Integrated Development Environment IDE The American Standard Code for Information Interchange ASCII The programmer has decided to use the following global variables: • a ten element 1D array IgnoreList of type STRING to store the ignored words • a string FNString to store the full name string. Assume that: • each alphabetic character in the full name string may be either upper or lower case • the full name string contains at least one word. The programmer has started to define program modules as follows: Module Description GetStart() • Called with an INTEGER as its parameter, representing the number of a word in FNString • Returns the character start position of that word in FNString or returns -1 if that word does not exist • For example: GetStart(3) applied to "hot and cold" returns 9 GetWord() • Called with the position of the first character of a word in FNString as its parameter • Returns the word from FNString • For example: if FNString contains the string "hot and cold", GetWord(9) returns "cold" IgnoreWord() • Called with a STRING parameter representing a word • Searches for the word in the IgnoreList array • Returns TRUE if the word is found, otherwise returns FALSE GetInitials() • Processes the sequence of words in the full name one word at a time • Calls GetStart(), GetWord() and IgnoreWord () to process each word to form the new string • Outputs the new string

  1. (a)Write pseudocode for the module IgnoreWord().[5]
  2. (b)Write pseudocode for the module GetInitials().[8]

Mark scheme

Marking points from the official mark scheme (May/June 2021). The mark or mark type is shown in brackets.

  1. [1] (a) FUNCTION IgnoreWord (ThisWord : STRING) RETURNS BOOLEAN
  2. [1] (a) DECLARE Found : BOOLEAN
  3. [1] (a) DECLARE Index : INTEGER
  4. [1] (a) Found ← False
  5. [1] (a) Index ← 1
  6. [1] (a) ThisWord ← TO_LOWER(ThisWord)
  7. [1] (a) REPEAT
  8. [1] (a) IF TO_LOWER(IgnoreList[Index]) = ThisWord THEN
  9. [1] (a) Found ← TRUE
  10. [1] (a) ENDIF
  11. [1] (a) Index ← Index + 1
  12. [1] (a) UNTIL Found = TRUE OR Index > 10
  13. [1] (a) RETURN Found
  14. [1] (a) ENDFUNCTION
  15. [1] (b) PROCEDURE GetInitials()
  16. [1] (b) DECLARE NewString, NextWord : STRING
  17. [1] (b) DECLARE ThisWordNum, Index : INTEGER
  18. [1] (b) ThisWordNum ← 0
  19. [1] (b) NewString ← ""
  20. [1] (b) REPEAT
  21. [1] (b) ThisWordNum ← ThisWordNum + 1
  22. [1] (b) Index ← GetStart(ThisWordNum)
  23. [1] (b) IF Index <> -1 THEN //if there is ThisWordNum
  24. [1] (b) NextWord ← GetWord (Index)
  25. [1] (b) IF IgnoreWord(NextWord) = FALSE THEN
  26. [1] (b) NewString ← NewString & UCASE(LEFT(NextWord, 1))
  27. [1] (b) ENDIF
  28. [1] (b) ENDIF
  29. [1] (b) UNTIL Index = -1
  30. [1] (b) OUTPUT NewString
  31. [1] (b) ENDPROCEDURE

Write your answer and get it marked

On Oracle Prep you can write or photograph your own answer and have it marked by AI against this mark scheme, with feedback on what you missed.

Sign up free →

About this question

Topic
Programming, A-Level Computer Science (syllabus 9618). Structured question, 13 marks.
Source
A-Level Computer Science, May/June 2021 Paper 2 Variant 2, question 8.

Questions and mark schemes are from past examination papers and remain the copyright of the exam board. How Oracle Prep builds its content

Related Computer Science questions

© 2026 Oracle Prep