Past-paper question · 2018 October-November · Paper 21 · Q2(c)(iv)

Question 2(c)(iv) 2018 · October-November · Paper 21 · 1 mark

Original past-paper question for 2(C)(IV)
Original past-paper question for 2(C)(IV)
Original past-paper question for 2(C)(IV)
Original past-paper question for 2(C)(IV)
Reveal official mark-scheme answer Official mark-scheme answer for 2(C)(IV)

Official answer for Question 2

Part (c)

(iv)

✓
Tried and tested // pre compiled (contains no syntax errors)

Question 1

Mark scheme 9608_w18_ms_21.pdf →

Show text version of question

Question 2

Part (c)

(iv)

Question 2

Shop customers have a discount card with a unique card number. Customers collect points after

they have bought items. The more points they have, the bigger the discount. If they shop on a Wednesday, their discount is increased by 20%.

The function GetDiscountRate() takes a card number as a parameter and returns the discount rate for a customer based on the number of points they have collected. A flowchart for the function is shown.

The function uses the following variables and functions.

Identifier Data type Description DRate REAL The discount rate CardNum STRING The unique customer card number Points INTEGER The number of points collected Takes the card number as a parameter and returns the GetPoints() FUNCTION number of points already collected Today() FUNCTION Returns the day number: 1 for Monday, 2 for Tuesday etc.

START

DRate 0

Points GetPoints(CardNum)

Is YES Points > 199 ? DRate 0.2

NO

Is YES Points > 99 ? DRate 0.1

NO

Is Today = YES DRate DRate * 1.2 Wednesday ?

NO

RETURN DRate

END

Question 5

There are different ways to minimise the risk of errors when writing programs, such as the use of constants and library routines.

(iv)

Give a reason why the use of library routines helps to minimise the risk of errors when

writing a program.

...........................................................................................................................................

.......................................................................................................................................[1]

Topic relevance

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_21.pdf

Keep practising this topic