Question 8(c) 2023 · October-November · Paper 21 · 4 marks
Reveal official mark-scheme answer
Official answer for Question 8
Part (c)
Question 4
- 1 and 1 (1) abnormal data for length to ensure that it is rejected (1)
Show text version of question
Question 8
Part (c)
Question 8
A programmer is designing an algorithm to calculate the cost of a length of rope.
The program requirements are:
- input two values: the length of rope in metres Length and the cost of one metre Cost
- perform a validation check on the length to ensure that the value is between 0.5 and 6.0
- calculate the price Price
- output the price rounded to two decimal places.
inclusive
Use the variable names given.
Part (c)
Give two different sets of test data for this algorithm and state the purpose of each set.
Set 1 .........................................................................................................................................
Purpose ....................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Set 2 .........................................................................................................................................
Purpose ....................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
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_w23_qp_21.pdf
