Past paper – IGCSE Computer Science (9–1) (0984)

Cambridge IGCSE · 0984

Computer Science (9–1) · Paper 21

May/June 2020 · 0984/21/M/J/20

Questions6
Marks50
TypeWritten

Answer on paper, open each mark scheme and give yourself marks, then open the Summary.

0 / 0Answer a question to start your score.
Saved 0
Advertisement
1
0984/21/M/J/20 · Question 1May/June 2020Paper 2120 marks
Loading question…
Question text

1
All variables, constants and other identifiers must have meaningful names.
(a) (i)
Identify two arrays you could have used for Task 1 and, in each case, state its purpose.
Array 1 …
Purpose …
…
…
Array 2 …
Purpose …
…
…
[4]
(ii)
Identify two variables you could have used for Task 1 and, in each case, state its
purpose.
Variable 1 …
Purpose …
…
…
Variable 2 …
Purpose …
…
…
[4]
(b) Explain why the item code data could not be stored as a real data type and identify the most
suitable data type for the item code data.
…
…
…
…
…
… [2]
(c) Write an algorithm to show how you input your choice of mobile device and SIM card (part of
Task 1), using either pseudocode, programming statements or a flowchart. It is not necessary
to show initialisation or setting up of arrays containing product details.
…
…

2
0984/21/M/J/20 · Question 2May/June 2020Paper 212 marks
Loading question…
Question text

Tick ( ü ) one box in each row to identify if the statement about structure diagrams is true or false.
2
False
True
Statement
( ü )
( ü )
A structure diagram is a piece of code that is available throughout the
structure of a program.
A structure diagram shows the hierarchy of a system.
A structure diagram is another name for an array.
A structure diagram shows the relationship between different components
of a system.
[2]

3
0984/21/M/J/20 · Question 3May/June 2020Paper 217 marks
Loading question…
Question text

3
Programs can perform validation and verification checks when data is entered.
(a) Give the names of two different validation checks and state the purpose of each one.
Check 1 …
Purpose …
…
…
Check 2 …
Purpose …
…
…
[4]
(b) Give the name of one verification check.
… [1]
(c) Describe the difference between validation and verification.
…
…
…
… [2]

Advertisement
4
0984/21/M/J/20 · Question 4May/June 2020Paper 218 marks
Loading question…
Question text

4
The pseudocode algorithm shown should allow numbers to be entered and should allow
50 numbers to be stored in an array.
←
0
Count
REPEAT
INPUT Values[Count]
←
Count + 1
Count
UNTIL Count = 0
(a) Explain why the algorithm will never end.
…
…
…
…
… [2]
(b) Re-write the original pseudocode so that it terminates correctly and also prevents numbers
below 100 from being stored in the array Values[ ]
…
…
…
…
…
…
…
…
…
… [4]
(c) Describe how you could change your pseudocode in part (b) so that it prevents numbers
below 100 and above 200 from being stored in the array Values[ ]
…
…
…
… [2]

5
0984/21/M/J/20 · Question 5May/June 2020Paper 216 marks
Loading question…
Question text

5
The flowchart represents an algorithm.
The predefined function DIV gives the value of the result of integer division,
←
9 DIV 4 gives y a value of 2
for example, y
An input value of –1 ends the algorithm.
START
INPUT
Value
IS
Yes
Value =
-1 ?
No
Calc1
Value DIV 2
Calc2
Value DIV 3
IS
No
Calc1 =
Value / 2 ?
Yes
IS
No
Calc2 =
Value / 3 ?
Yes
OUTPUT
Value
END
(a) Complete the trace table for the input data:
50, 33, 18, 15, 30, –1, 45, 12, 90, 6
Value
Calc1
Calc2
OUTPUT
[4]
(b) Describe the purpose of the algorithm.
…
…
… [2]

6
0984/21/M/J/20 · Question 6May/June 2020Paper 217 marks
Loading question…
Question text

6
A garden centre sells garden tools and stores details of these in a database table named TOOLS.
Code is the primary key in the TOOLS table.
Code
Description
Price ($)
Quantity_Stock
Quantity_Ordered
GFLG
Garden Fork
50.00
1
50
GSLG
Garden Spade
50.00
11
0
GHLG
Garden Hoe
45.00
8
0
HFSM
Hand Fork
9.99
42
0
HSSM
Hand Spade
9.99
40
0
HWSM
Hand Weeder
9.99
11
0
HS20
Hose (20 metres)
45.00
10
0
HS35
Hose (35 metres)
60.00
2
0
HS50
Hose (50 metres)
75.00
20
60
YBLG
Yard Brush
24.99
100
0
LMHD
Lawn Mower
99.99
5
0
LMBT
Lawn Mower (Battery)
249.99
7
0
LMPT
Lawn Mower (Petrol)
349.99
10
25
TRBT
Edge Trimmer (Battery)
79.99
15
0
TRPT
Edge Trimmer (Petrol)
59.99
20
0
SHSM
Shears
40.00
40
0
HCSM
Hedge Clippers
40.00
45
0
(a) State the purpose of the primary key in the TOOLS table.
…
…
… [1]
(b) List the output from the data shown in the table TOOLS that would be given by this query-by-
example.
Field:
Code
Description
Price ($)
Quantity_Stock
Quantity_Ordered
Table:
TOOLS
TOOLS
TOOLS
TOOLS
TOOLS
Sort:
Descending
Show:
ü
ü
ü
Criteria:
>40
>0
>0
or:
…
…
…
…
…
… [3]
(c) Complete the query-by-example grid to output the tools where the quantity in stock is below
25. Only show the Code, Description and Quantity_Stock fields in ascending order of Code.
Field:
Table:
Sort:
Show:
Criteria:
or:
[3]
Permission to reproduce items where third-party owned material protected by copyright is included has been sought and cleared where possible. Every
publisher will be pleased to make amends at the earliest possible opportunity.
To avoid the issue of disclosure of answer-related information to candidates, all copyright acknowledgements are reproduced online in the Cambridge
Assessment International Education Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download
at www.cambridgeinternational.org after the live examination series.
Cambridge Assessment International Education is part of the Cambridge Assessment Group. Cambridge Assessment is the brand name of the University of

Advertisement