Question 7(a) 2021 · May-June · Paper 23 · 7 marks
Reveal official mark-scheme answer
Official answer for Question 7
Part (a)
Question 7
Show text version of question
Question 7
Part (a)
Question 7
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
- Called with an INTEGER as a parameter, representing the number of a
- Returns the character start position of that word in FNString or
- For example: if FNString contains the string "hot and cold",
- Called with a parameter representing the position of the first character
- For example: if FNString contains the string "hot and cold",
word in FNString. GetStart()
returns –1 if that word does not exist
GetStart(3) returns 9
of a word in FNString GetWord() • Returns the word from FNString
GetWord(9) returns "cold"
Question 19
Part (a)
Write pseudocode for the module GetStart().
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Question 20
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
.............................................................................................................................................
Why this question appears here
91% 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 9618_s21_qp_23.pdf
