Past-paper question · 2015 May-June · Paper 23 · Q2(b)(ii)

Question 2(b)(ii) 2015 · May-June · Paper 23 · 5 marks

Original past-paper question for 2(B)(II)
Original past-paper question for 2(B)(II)
Original past-paper question for 2(B)(II)
Reveal official mark-scheme answer Official mark-scheme answer for 2(B)(II)

Official answer for Question 2

Part (b)

(ii)

(ii)

INPUT Amount

✓
IF Amount > 500
✓
THEN
✓
OUTPUT "Refused – amount too large"
✓
ELSE
✓
IF (Amount MOD 10) <> 0 / >0
✓
THEN
✓
OUTPUT "Refused - not a multiple of $10"
✓
ELSE
✓
FiftyDollar ← Amount DIV 50
✓
Temp ← Amount MOD 50 //
✓
(Amount – 50 * FiftyDollar)
✓
TwentyDollar ← Temp DIV 20 //
✓
(Amount MOD 50) DIV 20
✓
Temp ← Temp MOD 20
✓
TenDollar ← Temp DIV 10
✓
ENDIF
✓
ENDIF
✓
[max 5]

Mark scheme 9608_s15_ms_23.pdf →

Show text version of question

Question 2

Part (b)

(ii)

Bank customers withdraw money from their account at a cash dispenser machine using their bank card. The machine operates as follows:

  • it can dispense the following notes:
  • o $50 o $20 o $10

  • the maximum amount for a single withdrawal is $500

When a customer withdraws money, they enter the amount to withdraw. (This must be a multiple of $10).

The machine will always dispense the least possible number of notes.

A
program is designed for the machine to process a withdrawal.

The following variables are used:

Identifier Data type Description Amount INTEGER Amount to withdraw entered by the user

FiftyDollar INTEGER Number of $50 notes to dispense

TwentyDollar INTEGER Number of $20 notes to dispense

TenDollar INTEGER Number of $10 notes to dispense

Temp INTEGER Used in the calculation of the number of each note required

Question 5

(ii)

Complete the pseudocode.

INPUT .................................................................................................................................. IF Amount > 500 THEN OUTPUT "Refused – amount too large" ELSE ..................................................................................................................................

THEN OUTPUT "Refused - not a multiple of $10" ELSE FiftyDollar Amount DIV 50 Temp .................................................................................................... TwentyDollar .................................................................................... Temp ..................................................................................................... ..................................................................................................................... ENDIF ENDIF

[5]

Question 6

Topic relevance

Why this question appears here

71% assigned-topic match · Programming › Programming basics

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

Keep practising this topic