Question 2(b)(i) 2021 · May-June · Paper 42 · 2 marks
Reveal official mark-scheme answer
Official answer for Question 2
Part (b)
(i)
Question 1
mark per bullet point
Question 2
- Function header and close taking a booking ID as parameter AND return the calculated value
- Calculating hash value correctly using parameter
Show text version of question
Question 2
Part (b)
(i)
Question 2
A company stores bookings in a random file.
For each booking, the booking ID, customer ID, item ID and quantity are stored. These four values are all integers. Each booking ID is a value between 100 000 and 999 999 inclusive.
The hash value is calculated by dividing the booking ID by 100 000 and adding 3 to the remainder.
(i)
The function Hash() takes the booking ID as a parameter, calculates and returns the
hash value.
Write program code for the function Hash().
Programming language .................................................................
Program code
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.....................................................................................................................................
Why this question appears here
71% assigned-topic match · Programming › Structured programming
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_s21_qp_42.pdf
