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

Cambridge IGCSE · 0984

Computer Science (9–1) · Paper 22

Oct/Nov 2021 · 0984/22/O/N/21

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/22/O/N/21 · Question 1Oct/Nov 2021Paper 2220 marks
Loading question…
Question text

1
All variables, constants and other identifiers must have meaningful names.
(a) (i)
Identify one variable you could have used for Task 2 and state its use.
Variable …
Use …
…
…
[2]
(ii)
Describe the arrays you could have used in Task 1. Include the name, data type, use
and sample data for each array.
…
…
…
…
…
…
…
…
…
…
…
… [5]
(b) Describe how you could validate the data entry for the input of the codes for the different
stages of the journey in Task 2.
…
…
…
…
…
… [3]
(c) Write an algorithm to show how your program carries out Task 3, using either pseudocode,
programming statements or a flowchart. Assume Tasks 1 and 2 have already been completed.
…
…

2
0984/22/O/N/21 · Question 2Oct/Nov 2021Paper 223 marks
Loading question…
Question text

2
Tick (3) one box in each row to identify if the statement is about validation, verification or neither.
Validation
Verification
Neither
Statement
(3)
(3)
(3)
a check where data is re-entered to make sure no
errors have been introduced during data entry
an automatic check to make sure the data entered
has the correct number of characters
a check to make sure the data entered is sensible
a check to make sure the data entered is correct
[3]

3
0984/22/O/N/21 · Question 3Oct/Nov 2021Paper 226 marks
Loading question…
Question text

3
A program checks that the data entered is between 1 and 100 inclusive.
Identify one piece of normal, extreme and erroneous test data for this program, and give a reason
for each.
Normal test data …
Reason …
…
…
Extreme test data …
Reason …
…
…
Erroneous test data …
Reason …
…
…
[6]

Advertisement
4
0984/22/O/N/21 · Question 4Oct/Nov 2021Paper 2210 marks
Loading question…
Question text

4
The pseudocode algorithm should work as a calculator and output the result.
1
1 Continue
2 WHILE Continue = 0
3
OUTPUT "Enter 1 for +, 2 for -, 3 for * or 4 for /"
4
INPUT Operator
5
OUTPUT "Enter the first value"
6
INPUT Value1
7
OUTPUT "Enter the second value"
8
OUTPUT Value2
9
IF Operator
Value1 + Value2
10
1: Answer
Value1 - Value2
11
2: Answer
Value1 * Value2
12
3: Answer
Value1 / Value2
13
4: Answer
14
ENDCASE
15
OUTPUT "The answer is ", Value1
16
OUTPUT "Do you wish to enter more values (Yes or No)?"
17
INPUT MoreValues
18
IF MoreValues = "No"
19
THEN
1
20
Continue
21
ENDIF
22 UNTIL Continue = 0
(a) Find the five errors in the pseudocode and suggest a correction for each error.
Error 1 …
Correction …
…
Error 2 …
Correction …
…
Error 3 …
Correction …
…
Error 4 …
Correction …
…
Error 5 …
Correction …
…
[5]
(b) The algorithm needs changing to allow only the numbers 1, 2, 3, or 4 to be entered for the
input variable Operator.
Write the pseudocode to perform this task and state where in the algorithm it would be
located.
Pseudocode …
…
…
…
…
…
…

5
0984/22/O/N/21 · Question 5Oct/Nov 2021Paper 225 marks
Loading question…
Question text

5
The flowchart represents an algorithm.
The algorithm will terminate if –1 is entered at the List input.
START
← 0
List1
← 0
List2
INPUT
List
IS
Yes
List = –1 ?
No
INPUT
Value
← List1 + Value
Yes
IS
List1
List = 1 ?
No
← List2 + Value
Yes
IS
List2
List = 2 ?
OUTPUT
"List 1 = ", List1
No
OUTPUT
OUTPUT
"Input Error"
"List 2 = ", List2
IS
Yes
List1 > List2 ?
No
OUTPUT
"List 1 is greatest"
OUTPUT
"List 2 is greatest"
END
Complete the trace table for the algorithm using this input data:
2, 77, 2, 16, 1, 35, 2, –7, 5, 18, 1, 11, 1, 12, 2, 20, –1, 18
List
Value
List1
List2
OUTPUT
[5]

6
0984/22/O/N/21 · Question 6Oct/Nov 2021Paper 226 marks
Loading question…
Question text

6
A pet supplier uses the database table, STOCK, to keep records of its products for pets.
The fields are:
Field name
Description
ProductID
code to identify the product
ProductName
name of product
ProductDescription
information about the product
Animal
type of animal the product is for, e.g. cat, bird, horse
ProductType
type of product, e.g. food, toy, medicine
whether the product is in stock or not
InStock
(a) (i)
Identify the field that could have a Boolean data type.
… [1]
(ii)
Identify the field that should be used as the primary key.
… [1]
(b) Complete the query-by-example grid to output the products intended for a cat that are in
stock. Display only the primary key and the name of the products. The output should be
sorted by the primary key.
Field:
Table:
Sort:
Show:
Criteria:
or:
[4]
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