Past paper – IGCSE Computer Science (9–1) (0984)
Cambridge IGCSE · 0984
Computer Science (9–1) · Paper 22
Oct/Nov 2019 · 0984/22/O/N/19
Answer on paper, open each mark scheme and give yourself marks, then open the Summary.
Question text
1
(a) All variables, constants and other identifiers must have meaningful names.
(i)
Describe the data structures that you have used to store the data for the concrete slabs
in Task 1, include the name, data type and use for each data structure.
…
…
…
…
…
…
…
…
…
…
… [5]
(ii)
State one variable that you have used in Task 3.
Give the data type for the variable. State what it is used for.
Variable name …
Data type …
Use …
…
[3]
(b) Explain how you calculated the volume of a concrete slab in Task 1.
…
…
…
…
…
… [3]
(c) Write an algorithm for Task 2, using either pseudocode, programming statements or a
flowchart. Assume that Task 1 has been completed.
…
…
…
Question text
2
An algorithm has been written in pseudocode to select a random number using the function
RandInt(n), which returns a whole number between 1 and the argument n. The algorithm then
allows the user to guess the number.
RandInt(100)
Number
1
TotalTry
REPEAT
PRINT "Enter your guess now, it must be a whole number"
INPUT Guess
IF TotalTry > Number
THEN
PRINT "Too large try again"
ENDIF
IF Guess > Number
THEN
PRINT "Too small try again"
ENDIF
Guess + 1
TotalTry
UNTIL Guess <> Number
TotalTry - 1
TotalTry
PRINT "Number of guesses ", TotalTry
Find the four errors in the pseudocode and suggest a correction to remove each error.
Error 1 …
Correction …
…
Error 2 …
Correction …
…
Error 3 …
Correction …
…
Error 4 …
Correction …
…
[4]
Question text
3
(a) The flowchart checks the lengths of a batch of 10 ropes. For the batch to be accepted 90% of
the lengths need to be between 24.9 and 25.1 metres.
START
Reject
0
Count
0
Yes
Is Count =
10 ?
No
No
Is Reject
Count
Count + 1
<= 1 ?
INPUT Length
Yes
OUTPUT "Batch
rejected"
Is Length <
Yes
25.1 AND
Length > 24.9 ?
No
Reject
Reject + 1
OUTPUT "Batch
accepted"
END
Complete the trace table for the input data:
24.88, 25.01, 24.98, 25.00, 25.05, 24.99, 24.97, 25.04, 25.19, 25.07
Reject
Count
Length
OUTPUT
[4]
(b) (i)
It has been decided to only reject batches of rope that contain ropes that are too short.
State the change required to the algorithm.
…
… [1]
(ii)
Explain how the algorithm to reject batches could be improved to make it more effective.
…
…
…
… [2]
Question text
4
Four validation checks and four descriptions are shown.
Draw a line to connect each validation check to the correct description.
Validation Check
Description
Checks that some data is entered.
Range check
Checks for a maximum number of characters
Presence check
in the data entered.
Checks that the characters entered are all
Length check
numbers.
Checks that the value entered is between an
Type check
upper value and a lower value.
[3]
Question text
5
A programmer writes a program to weigh baskets of fruit in grams, keeping a total of the weight
and counting the number of baskets. The total weight is stored in a variable Total and the number
of baskets is stored in a variable BasketCount.
Explain, including examples of programming statements, how totalling and counting could be used
in this program.
Totalling …
…
…
…
…
…
Counting …
…
…
…
…
…
[4]
Question text
6
Explain why constants, variables and arrays are used in programming.
Constants …
…
…
…
Variables …
…
…
…
Arrays …
…
…
…
[6]
Question text
7
A database table, SALES, is used to keep a record of items made and sold by a furniture maker.
Item number
Order number
Notes
Amount
Status
CH001
1921
Smith – six dining chairs
6
Delivered
TB003
1921
Smith – large table
1
In progress
CH001
1924
Hue – extra chairs
4
In progress
CH003
1925
For stock
2
Cancelled
BN001
1927
Patel – replacement bench
1
Not started
ST002
1931
Sola – small table
1
Delivered
CH003
1927
Patel – eight dining chairs with arms
8
Not started
TB003
1927
Patel – large table
1
Not started
(a) Explain why the field Item number could not be used as a primary key.
…
… [1]
(b) A query-by-example has been written to display only the order number and item numbers of
any items in progress or not started.
Field:
Item number
Order number
Amount
Status
Table:
SALES
SALES
SALES
SALES
Sort:
Show:
3
3
Criteria:
Not Like "Delivered"
or:
Explain why the query-by-example is incorrect, and write a correct query-by-example.
Explanation …
…
…
…
…
Field:
Table:
Sort:
Show:
Criteria:
or:
[5]
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