Question 5(b)(ii) 2024 · February-March · Paper 22 · 4 marks
Reveal official mark-scheme answer
Official answer for Question 5
Part (b)
(ii)
Question 4
- presence check (1) to check that values have been input (1)
- type check (1) to check for numerical values (1)
Show text version of question
Question 5
Part (b)
(ii)
Question 5
An algorithm has been written in pseudocode to calculate the profit when an item is sold. Values
for cost price and selling price are input, the profit is calculated (selling price – cost price) and output. The input of zero for either value stops the algorithm.
01 REPEAT 02 OUTPUT "Enter cost price " 03 INPUT Cost 04 OUTPUT "Enter selling price " 05 OUTPUT Sell 06 IF Cost <> 0 OR Sell <> 0 07 THEN 08 Profit Sell - Cost ← 09 OUTPUT "Profit is ", Profit 10 NEXT 11 UNTIL Cost = 0 OR Sell = 0 This algorithm needs to be improved with a range check.
(ii)
Describe two other validation checks that should be included in this algorithm.
Check 1 .............................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
Check 2 .............................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
Question 8
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 0478_m24_qp_22.pdf
