Imp P2 (1) QP
Imp P2 (1) QP
Imp P2 (1) QP
(a) Draw a line to link each pseudocode description to the most appropriate pseudocode
statement.
FOR…TO…NEXT
IF…THEN…ELSE…ENDIF
WHILE…DO…ENDWHILE
CASE…OF…OTHERWISE…ENDCASE
REPEAT…UNTIL
[4]
(b) Using a single loop, write an algorithm in pseudocode to output 50 names that have been
stored in the array, Name[]
....................................................................................................................................................
....................................................................................................................................................
....................................................................................................................................................
....................................................................................................................................................
....................................................................................................................................................
................................................................................................................................................[3]
2 Describe the purpose of validation and verification checks during data entry.
Validation check.................................................................................................................................
...........................................................................................................................................................
...........................................................................................................................................................
...........................................................................................................................................................
Verification check...............................................................................................................................
...........................................................................................................................................................
...........................................................................................................................................................
...........................................................................................................................................................
[4]
3 Tick () one box to show the named section of a program that performs a specific task.
A file
B function
C parameter
D process
[1]
Draw a structure diagram for this part of the satellite navigation system.
[4]
5 An algorithm has been written in pseudocode to input some numbers. It only outputs any numbers
that are greater than or equal to 100. The number 999 is not output and stops the algorithm.
INPUT Number
WHILE Numbers <> 999 DO
IF Number > 100
THEN
OUTPUT Number
ENDIF
ENDWHILE
OUTPUT Number
(a) Identify the four errors in the pseudocode and suggest corrections.
Error 1 ........................................................................................................................................
Correction ..................................................................................................................................
....................................................................................................................................................
Error 2 ........................................................................................................................................
Correction ..................................................................................................................................
....................................................................................................................................................
Error 3 ........................................................................................................................................
Correction ..................................................................................................................................
....................................................................................................................................................
Error 4 ........................................................................................................................................
Correction ..................................................................................................................................
....................................................................................................................................................
[4]
(b) Write a pseudocode statement to change the corrected algorithm to output all numbers
between 100 and 200 inclusive.
....................................................................................................................................................
....................................................................................................................................................
....................................................................................................................................................
............................................................................................................................................... [2]
B X
[4]
(b) Complete the truth table from the given logic expression.
Working space
A B C X
0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1
[4]
START
Flag 0
Count 1
IS Name[Count] Yes
> Name[Count + 1]? Temp Name[Count]
No Name[Count] Name[Count + 1]
Name[Count + 1] Temp
Flag 1
Count Count + 1
No IS Count
=4?
Yes
No IS Flag
=0?
Yes
STOP
(a) The array Name[1:4] used in the flowchart contains the following data:
Complete the trace table using the data given in the array.
[5]
....................................................................................................................................................
....................................................................................................................................................
....................................................................................................................................................
............................................................................................................................................... [2]
8 A programmer has written an algorithm to check that prices are less than $10.00
10.00 .................................................................................................................................................
...........................................................................................................................................................
9.99 ...................................................................................................................................................
...........................................................................................................................................................
ten .....................................................................................................................................................
...........................................................................................................................................................
[3]
...........................................................................................................................................................
...........................................................................................................................................................
...........................................................................................................................................................
...........................................................................................................................................................
...........................................................................................................................................................
...................................................................................................................................................... [3]
Tick () one box which accurately describes the use of the variable Inches
A answer
B call
C parameter
D response
[1]
© UCLES 2020 2210/02/SP/23
11
............................................................................................................................................... [1]
(b) (i) Give the name of the field that would be used for the primary key.
....................................................................................................................................... [1]
(ii) State the reason for choosing this field for the primary key.
............................................................................................................................................
....................................................................................................................................... [1]
(c) Complete the table to identify the most appropriate data type for each field based on the data
shown in the database table, 2018MOV.
CatNo
Title
Genre1
Streaming
[2]
(d) Complete the structured query language (SQL) to return the category number and title for all
Comedy movies.
.................................................. 2018MOV
• X stores a string
• Y stores a position in the string (e.g. 2)
• Z stores the number of characters in the string.
....................................................................................................................................................
....................................................................................................................................................
....................................................................................................................................................
....................................................................................................................................................
....................................................................................................................................................
............................................................................................................................................... [3]
....................................................................................................................................................
....................................................................................................................................................
....................................................................................................................................................
....................................................................................................................................................
....................................................................................................................................................
....................................................................................................................................................
....................................................................................................................................................
....................................................................................................................................................
....................................................................................................................................................
....................................................................................................................................................
....................................................................................................................................................
............................................................................................................................................... [6]
13 The 1D array StudentName[] contains the names of students in a class. The 2D array
StudentMark[] contains the mark for each subject, for each student. The position of
each student’s data in the two arrays is the same, for example, the student in position 10 in
StudentName[] and StudentMark[] is the same.
The variable ClassSize contains the number of students in the class. The variable SubjectNo
contains the number of subjects studied. All students study the same number of subjects.
The arrays and variables have already been set up and the data stored.
You must use pseudocode or program code and add comments to explain how your code works.
...........................................................................................................................................................
...........................................................................................................................................................
...........................................................................................................................................................
...........................................................................................................................................................
...........................................................................................................................................................
...........................................................................................................................................................
...........................................................................................................................................................
...........................................................................................................................................................
...........................................................................................................................................................
...........................................................................................................................................................
...........................................................................................................................................................
...........................................................................................................................................................
...........................................................................................................................................................
...........................................................................................................................................................
...........................................................................................................................................................
...........................................................................................................................................................
...........................................................................................................................................................
...........................................................................................................................................................
...........................................................................................................................................................
...........................................................................................................................................................
...........................................................................................................................................................
...........................................................................................................................................................
...........................................................................................................................................................
...........................................................................................................................................................
...........................................................................................................................................................
...........................................................................................................................................................
...........................................................................................................................................................
...........................................................................................................................................................
...........................................................................................................................................................
...........................................................................................................................................................
...........................................................................................................................................................
...........................................................................................................................................................
...........................................................................................................................................................
...........................................................................................................................................................
...........................................................................................................................................................
...........................................................................................................................................................
...........................................................................................................................................................
...........................................................................................................................................................
© UCLES 2020 2210/02/SP/23 [Turn over
16
...........................................................................................................................................................
...........................................................................................................................................................
...........................................................................................................................................................
...........................................................................................................................................................
...........................................................................................................................................................
...........................................................................................................................................................
...........................................................................................................................................................
...........................................................................................................................................................
...........................................................................................................................................................
...........................................................................................................................................................
...........................................................................................................................................................
...........................................................................................................................................................
...........................................................................................................................................................
...........................................................................................................................................................
...........................................................................................................................................................
...........................................................................................................................................................
...........................................................................................................................................................
...........................................................................................................................................................
...........................................................................................................................................................
...........................................................................................................................................................
...........................................................................................................................................................
.................................................................................................................................................... [15]
Permission to reproduce items where third-party owned material protected by copyright is included has been sought and cleared where possible. Every
reasonable effort has been made by the publisher (UCLES) to trace copyright holders, but if any items requiring clearance have unwittingly been included, the
publisher will be pleased to make amends at the earliest possible opportunity.
Cambridge Assessment International Education is part of the Cambridge Assessment Group. Cambridge Assessment is the brand name of the University of
Cambridge Local Examinations Syndicate (UCLES), which itself is a department of the University of Cambridge.