Question 2(b) 2018 · October-November · Paper 41 · 4 marks
Reveal official mark-scheme answer
Official answer for Question 2
Part (b)
Question 1
mark per bullet point to max 4:
Question 4
Show text version of question
Question 2
Part (b)
Question 2
Kendra collects books. She is writing a program to store and analyse information about her books.
Her program stores information about each book as a record. The following table shows the information that will be stored about each book.
Field name Description Title The title of the book Author The first listed author of the book
ISBN for example: Fiction If the book is fiction (TRUE) or non-fiction (FALSE) LastRead The date when Kendra last read the book
Part (b)
The records are stored in a random access file.
The function, Hash(), takes as a parameter the ISBN and returns the hash value.
The disk address of the record in the hash table is calculated as: ISBN modulus 2000 plus 1.
Write program code for the function Hash().
Programming language ............................................................................................................
Program code ...........................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
..............................................................................................................................................
Question 6
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_w18_qp_41.pdf
