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 -----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 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" (a) Write pseudocode for the module GetStart(). (b) The programmer has decided to use a global ten-element 1D array IgnoreList of type STRING to store the ignored words. Unused elements contain the empty string ("") and may occur anywhere in the array. A new module AddWord() is needed as follows: Module | Description ----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- AddWord() | • Called with a parameter representing a word • Stores the word in an unused element of the IgnoreList array and returns TRUE • Returns FALSE if the array was already full or if the word was already in the array Write a detailed description of the algorithm for AddWord(). Do not include pseudocode statements in your answer. (c) As a reminder, the module description of GetWord () is repeated: Module | Description ----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 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" Write pseudocode for the module GetWord().
✓ Correct Answer
The correct answer is —. This question tests the candidate's understanding of string manipulation within the Computer Sciencesyllabus. The examiner's mark scheme requires...
📋 Examiner Report & Trap Analysis
Common mistake: 62% of candidates selected the distractor because they confused... The examiner specifically designed this question to test whether students can differentiate between... To secure full marks, candidates must demonstrate...
Unlock the Examiner's Answer
Sign up for free to reveal the correct answer, the official mark scheme breakdown, and the examiner trap analysis for this question.
Sign Up Free to Unlock →Join thousands of Cambridge students already using Oracle Prep