Question 22(b) 2021 · October-November · Paper 22 · 16 marks
Reveal official mark-scheme answer
The answer for this question is in the official mark scheme: open the mark scheme.
Show text version of question
Question 22
Part (b)
Question 22
UNTIL Continue = 0
Part (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 ..............................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Location in algorithm ................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Question 10
5 The flowchart represents an algorithm.
The algorithm will terminate if –1 is entered at the List input.
START
List1 ←0 List2 ←0 INPUT List
Yes IS List = –1 ?
No
INPUT Value
IS List = 1 ? Yes List1 ← List1 + Value No
IS List = 2 ? Yes List2 ← List2 + Value OUTPUT "List 1 = ", List1 No
OUTPUT OUTPUT "List 2 = ", List2 "Input Error"
IS Yes List1 > List2 ?
No OUTPUT "List 1 is greatest"
OUTPUT "List 2 is greatest"
END
Question 11
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
Question 12
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 InStock whether the product is in stock or not
Part (a)
(i)
Identify the field that could have a Boolean data type.
.....................................................................................................................................
(ii)
Identify the field that should be used as the primary key.
.....................................................................................................................................
Part (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:
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.
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 Cambridge Local Examinations Syndicate (UCLES), which itself is a department of the University of Cambridge.
Why this question appears here
98% assigned-topic match · Algorithm design and problem-solving
Topic-match percentages estimate how closely each question fits the selected syllabus topic. They are a guide for choosing stricter or broader practice.
Permanent source page: Educate A Change · From 2210_w21_qp_22.pdf
