Question 2(b)(i) 2015 · May-June · Paper 23 · 3 marks
Reveal official mark-scheme answer
Official answer for Question 2
Part (b)
(i)
Part (b)
(i)
Question 70
Question 1
Question 1
Question 85
Question 2
Question 1
Question 1
Show text version of question
Question 2
Part (b)
(i)
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:
- the maximum amount for a single withdrawal is $500
o $50 o $20 o $10
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.
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
(i)
The following four tests have been designed.
Complete the test data table showing the expected results with comments.
Input value Output Comment Amount FiftyDollar TwentyDollar TenDollar
70 1 1 0 Least possible number of notes
Question 85
130
600
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
