Computer Assignment for AS 11
Computer Assignment for AS 11
* 8 4 1 6 1 0 0 9 4 2 *
INSTRUCTIONS
● Answer all questions.
● Use a black or dark blue pen.
● Write your name, centre number and candidate number in the boxes at the top of the page.
● Write your answer to each question in the space provided.
● Do not use an erasable pen or correction fluid.
● Do not write on any bar codes.
● You may use an HB pencil for any diagrams, graphs or rough working.
● Calculators must not be used in this paper.
INFORMATION
● The number of marks for each question or part question is shown in brackets [ ].
● No marks will be awarded for using brand names of software packages or hardware.
● The insert contains all the resources referred to in the questions.
DC (PQ/CGW) 329348/4
© UCLES 2024 [Turn over
Refer to the insert for the list of pseudocode functions and operators.
(a) The following table shows four valid pseudocode assignment statements.
Complete the table by giving an appropriate data type to declare each of the variables A, B, C
and D.
Variable Value
Sorted False
Tries 9
ID "ZGAC001"
Complete the table by evaluating each expression, using the example values.
Expression Evaluates to
Tries MOD 4
TO_LOWER(MID(ID, 3, 1))
(c) The variable names A, B, C and D in part (a) are not good programming practice.
...........................................................................................................................................
..................................................................................................................................... [1]
(ii) Identify one problem that these variable names might cause.
...........................................................................................................................................
..................................................................................................................................... [1]
(iii) The choice of suitable variable names is one example of good programming practice.
...........................................................................................................................................
..................................................................................................................................... [1]
START
INPUT A, B
Yes
No
END
[5]
© UCLES 2024 9618/21/M/J/24
5
Following the input of ThisSequence the revised algorithm will extract the pairs of numbers.
Describe the variable ThisSequence and how the numbers are extracted.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
3 A global 1D array of strings contains three elements which are assigned values as shown:
Data[1] "aaaaaa"
Data[2] "bbbbbb"
Data[3] "cccccc"
Result "****"
CASE OF C
'X' : Result TO_UPPER(Data[Index])
'Y' : Result TO_LOWER(Data[Index])
'Z' : Result "**" & Data[Index]
ENDCASE
Data[Index] LEFT(Result, L)
NEXT Count
ENDPROCEDURE
(a) Complete the trace table by dry running the procedure when it is called as follows:
CALL Process("X3Y2W4")
[6]
(b) The procedure is to be modified. If variable C is assigned a value other than 'X', 'Y' or 'Z',
then procedure Error() is called and passed the value of variable C as a parameter.
..................................................................................................................................... [1]
..................................................................................................................................... [1]