Computer Science · Oct / Nov 2022 · Paper 21 · Question 4
0478
As printed in the paper
The question as text
This algorithm makes sure that there are enough fresh bread rolls available for customers to buy. START INPUT Sold IS Sold = –1? Stock 50 Total 0 STOP Yes No OUTPUT Total OUTPUT "Add new stock" IS Stock < 20? Yes No Stock Stock – Sold Stock Stock + 50 Total Total + Sold
Read automatically from the paper; the printed page above is exact.
Show the answer and mark scheme
4(a)[4]
One mark for each correct column, max four
Sold
Stock
Total
OUTPUT
50
0
24
26
24
12
14
Add new stock
64
36
6
58
42
30
28
72
12
16
Add new stock
66
84
18
48
102
-1
102
4(b)[3]
One mark for identification of error, max one
the stock level will fall below zero / become negativeOne mark per mark point, max two
before subtracting the amount Sold from Stocktest that the stock level / Stock is greater than the rolls to be sold / Soldprovide a suitable error message / ask to re-input
Make a free account to save your answers and see your weak topics and ask the AI why a wrong answer is wrong.

