Note AcademyNote Academy

Computer Science (AS & A Level) · May / June 2021 · Paper 22 · Question 7

9618

As printed in the paper

The question as text

A procedure, FormatName(): • is called with a string containing words and spaces as its parameter. In this context, a word is any sequence of characters that does not contain a space character. • creates a new formatted string from this string with the following requirements: 1. Any leading spaces removed (spaces before the first word). 2. Any trailing spaces removed (spaces after the last word). 3. Any multiple spaces between words converted to a single space. 4. All characters converted to lower case. The FormatName() procedure has been written in a programming language and is to be tested using the black-box method.

Read automatically from the paper; the printed page above is exact.

Show the answer and mark scheme
  • 7(a)[3]

  • 7(b)[2]

Make a free account to save your answers and see your weak topics and ask the AI why a wrong answer is wrong.