Computer Science · Oct / Nov 2023 · Paper 22 · Question 7
0478
As printed in the paper
The question as text
The string operation SUBSTRING(Quote, Start, Number) returns a string from Quote beginning at position Start that is Number characters long. The first character in Quote is in position 1. Write pseudocode statements to: • store the string "Learning Never Exhausts The Mind" in Quote • extract and display the words "The Mind" from the string • output the original string in lower case. [5]
Read automatically from the paper; the printed page above is exact.
Show the answer and mark scheme
One mark per mark point, max five
MP1
storing string in Quote
MP2
correct assignment for Start // sending correct start value MP3
correct assignment for Number // sending correct number of characters
MP4
use of SUBSTRING function with first parameter as Quote, or equivalent, plus two other parameters
MP5
correct use of LCASE function
MP6
two correct outputs
For example:
Quote ← "Learning Never Exhausts The Mind"
Start ← 25
Number ← 8
OUTPUT SUBSTRING(Quote, Start, Number)
OUTPUT LCASE(Quote)
Make a free account to save your answers and see your weak topics and ask the AI why a wrong answer is wrong.

