Computer Science (AS & A Level) · May / June 2021 · Paper 21 · Question 7
9618
As printed in the paper
The question as text
A program is needed to take a string containing a full name and 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 abbreviated 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 a global variable FNString of type STRING to store the full name. It is assumed that: • words in the full name string are separated by a single space character • space characters will not occur at the beginning or the end of the full name string • 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 a 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: if FNString contains the string "hot and cold", GetStart(3) returns 9 GetWord() • Called with a parameter representing the position of the first character of a word in FNString • Returns the word from FNString • For example: if FNString contains the string "hot and cold", GetWord(9) returns "cold"
Read automatically from the paper; the printed page above is exact.
Show the answer and mark scheme
7(a)[7]
7(b)[4]
7(c)[5]
Make a free account to save your answers and see your weak topics and ask the AI why a wrong answer is wrong.

