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

Question 2(c)(v) 2018 · October-November · Paper 21 · 2 marks

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

Official answer for Question 2

Part (c)

(v)

Question 1

mark for feature (Name) and 1 mark for corresponding description (explanation)

Question 2

✓
Example:
✓
Name: Meaningful variable names
✓
Explanation: To reduce the risk of referring to the wrong variable / make the code
✓
easier to understand
✓
Name: Indentation
✓
Explanation: To see where loops / selection start / end // indicate program structure
✓
Name: Variable type-checking as part of module interface
✓
Explanation: Reduces the risk of using an incorrect parameter
✓
Name: Pretty-Printing
✓
Explanation: Highlights the error / auto-complete / type checking
✓
Name: / Dynamic Syntax Checking
✓
Explanation: Highlights the error as code is typed in
✓
9608/21
✓
Cambridge International AS/A Level – Mark Scheme
✓
October/November
✓
PUBLISHED
✓
2018
✓
Question
✓
Answer
✓
Marks

Mark scheme 9608_w18_ms_21.pdf →

Show text version of question

Question 2

Part (c)

(v)

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.

(v)

Constants and library routines help to minimise the risk of errors.

Name another way that you can minimise the risk of errors when writing a program. Explain how this helps.

Name .................................................................................................................................

Explanation .......................................................................................................................

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

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

[2]

Question 8

Topic relevance

Why this question appears here

72% 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