Question 2(c) 2018 · October-November · Paper 23 · 4 marks
Reveal official mark-scheme answer
Official answer for Question 2
Part (c)
Question 4
Show text version of question
Question 2
Part (c)
Question 2
Shop customers have a discount card with a unique card number. Customers collect points when
they buy items. At the end of each year, customers are given bonus (extra) points related to the total amount they have spent during the year, and the number of points they have on their card.
The function CalcBonus() takes the card number as a parameter. It returns the bonus points for the customer. A flowchart for the function is shown.
The function uses the following variables and functions.
Identifier Data type Description CardNum STRING A numeric string representing the unique card number Points INTEGER The number of points collected Spend REAL The total amount that customer has spent during the year Bonus INTEGER The number of bonus points Takes the card number as a parameter and returns the GetPoints() FUNCTION number of points already collected Takes the card number as a parameter and returns the GetSpend() FUNCTION total amount that customer has spent during the year
START
Points GetPoints(CardNum)
Spend GetSpend(CardNum)
Is YES Points > 2000 ?
NO
Is YES Spend > 1000 ?
NO
Bonus 10 Bonus 50 Bonus 100
RETURN Bonus
END
Question 5
Part (c)
Name two types of program maintenance and state the reason why each is needed.
Name ........................................................................................................................................
Reason .....................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Name ........................................................................................................................................
Reason .....................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Question 8
Why this question appears here
82% assigned-topic match · Data types and structures › Data types and records
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 9608_w18_qp_23.pdf
