Past-paper question · 2015 October-November · Paper 22 · Q3

Question 3 2015 · October-November · Paper 22 · 6 marks

Original past-paper question for 3
Original past-paper question for 3
Original past-paper question for 3
Reveal official mark-scheme answer Official mark-scheme answer for 3Official mark-scheme answer for 3

Official answer for Question 3

✓
START
✓
START and STOP/END
✓
to score
✓
INPUT
✓
Amount(Due)
✓
A. CALCULATE
✓
CALL
✓
points total
✓
CalculatePoints(AmountDue)
✓
In general – accept
✓
descriptive assignment
✓
PointsTotal =
✓
statements
✓
PointsTotal + NewPoints
✓
Condition + at least one
✓
PointsTotal
✓
label to score
✓
> 500
✓
A. True/Tick
✓
YES
✓
OUTPUT
✓
“Exchange points?”
✓
INPUT
✓
Response
✓
Response = “YES”?
✓
quotes
✓
YES
✓
PointsTotal =
✓
PointsTotal - 500
✓
AmountDue = AmountDue - 1
✓
OUTPUT
✓
AmountsDue, PointsTotal
✓
STOP
✓
[Max 6]
✓
Mark Scheme
✓
Syllabus
✓
Paper
✓
Cambridge International AS/A Level – October/November 2015
✓
9608

Question 22

Mark scheme 9608_w15_ms_22.pdf →

Show text version of question

Question 3

Regular customers at a supermarket use a rewards card at the point-of-sale.

Points are calculated from every transaction and added to the points total stored on the card.

One reward point is given for every $1 spent.

When the points total exceeds 500, the customer can either:

  • pay the full amount due and increase their points total
  • get $1 deducted from the amount due in exchange for 500 reward points

The new points total and amount to be paid is printed on the receipt.

A
program is to be written with the following specification:
  • read the points total from the card
  • process the amount spent
  • output the amount to be paid and the new points total
A
user-defined function CalculatePoints has already been coded to calculate the new points

earned from the amount spent.

Study the following pseudocode:

INPUT AmountDue NewPoints ← CalculatePoints(AmountDue) PointsTotal ← PointsTotal + NewPoints

IF PointsTotal > 500 THEN OUTPUT "Exchange points?" INPUT Response IF Response = "YES" THEN PointsTotal ← PointsTotal – 500 AmountDue ← AmountDue – 1 ENDIF ENDIF

OUTPUT AmountDue, PointsTotal

The algorithm is also to be documented with a program flowchart.

Complete the flowchart by:

  • filling in the flowchart boxes
  • labelling, where appropriate, lines of the flowchart

Question 5

CALL CalculatePoints(AmountDue)

[6]

Question 6

Topic relevance

Why this question appears here

82% assigned-topic match · Algorithm design and problem-solving › Algorithms

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

Keep practising this topic