Computer Science (AS & A Level) · Oct / Nov 2024 · Paper 21 · Question 4
9618
As printed in the paper
The question as text
A program includes the following assignment statement: Result ← STR_TO_NUM(x) / STR_TO_NUM(y) When the program evaluates the expression in the statement, it performs a calculation. Variable Result is of type real and variables x and y are of type string. Two checks are required before the calculation is performed: 1. The two strings represent valid numeric values. 2. The numeric value of string y is not zero.
Read automatically from the paper; the printed page above is exact.
Show the answer and mark scheme
4(a)[2]
4(b)[2]
4(c)[6]
Make a free account to save your answers and see your weak topics and ask the AI why a wrong answer is wrong.

