Question 4(b) 2016 · October-November · Paper 22 · 4 marks
Reveal official mark-scheme answer

Official answer for Question 4
Part (b)
Part (b)
‘Pseudocode’ solution included here for development and clarification of mark scheme.
- Declaration of all variables used including data types
- Loop
- Assignment / calculation of (four) different random numbers (0 to 150) in a loop
- Output of four values
Question 1
Question 1
Question 1
Question 1
- Declaration of all variables used including data types
- Assignment of four different random numbers (0 to 150)
- Assignment to four separate variables
- Output of four values
Question 22
Show text version of question
Question 4
Part (b)
Question 4
A social club runs a weekly prize draw. A member can buy a ticket for $2. Each week, the club
sells up to 150 tickets, with consecutive numbers starting from 1. There is a main cash prize of $120 and a further three prizes of $10. The computer program will generate the winning numbers.
Throughout this question, you will need to refer to the list of pseudocode functions in the Appendix.
Part (b)
Write program code to generate and output four winning numbers.
Ignore the issue that duplicate numbers may be generated.
Visual Basic and Pascal: You should include declaration statements for variables. Python: You should show a comment statement for each variable used with its data type.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
..............................................................................................................................................
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_w16_qp_22.pdf
