Computer Science (AS & A Level) · Oct / Nov 2023 · Paper 23 · Question 6
9618
As printed in the paper
The question as text
A function TestNum() will take a six-digit string as a parameter. The function will test whether the string meets certain conditions and will return an integer value as follows: Return value Condition Example 1 The last three digits are the same but non-zero. "253444" 2 The last three digits are zero. "253000" 3 The first three and last three digits are the same. "410410" The function will return the highest possible value for the given string. If the string does not meet any of the conditions, zero is returned. 13 Write pseudocode for function TestNum(). Assume that the parameter is valid. [6]
Read automatically from the paper; the printed page above is exact.
Show the answer and mark scheme
Make a free account to save your answers and see your weak topics and ask the AI why a wrong answer is wrong.

