Past-paper question · 2015 October-November · Paper 41 · Q5(b)(v)

Question 5(b)(v) 2015 · October-November · Paper 41 · 4 marks

Question 5

Part (b)

(v)

Question 5

Data about sports club members are stored in a random file of records.

  • The key field of a member record is the member ID (range 1000 to 9999).
  • Other member data are stored.
  • A hashing function is used to calculate a record address.
  • The random file initially consists of dummy records.
  • Dummy records are shown by member ID set to 0.

FUNCTION Hash(MemberID : INTEGER) RETURNS INTEGER

Address ← MemberID MOD 100

RETURN Address

ENDFUNCTION

(v)

Write pseudocode to implement the method you described in part (b)(iv).

Choose line numbers to indicate where your pseudocode should be inserted in the pseudocode of part (b)(i).

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

.......................................................................................................................................[4]

effort has been made by the publisher (UCLES) to trace copyright holders, but if any items requiring clearance have unwittingly been included, the publisher will be pleased to make amends at the earliest possible opportunity.

To avoid the issue of disclosure of answer-related information to candidates, all copyright acknowledgements are reproduced online in the Cambridge International Examinations Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download at www.cie.org.uk after the live examination series.

Cambridge International Examinations is part of the Cambridge Assessment Group. Cambridge Assessment is the brand name of University of Cambridge Local Examinations Syndicate (UCLES), which is itself a department of the University of Cambridge.

Reveal official mark-scheme answer Official mark-scheme answer for 5(B)(V)

Official answer for Question 5

Part (b)

(v)

(v)

41 GETRECORD "MembershipFile", CurrentRecord

✓
42 WHILE CurrentRecord.MemberID <> 0
✓
NewAddress NewAdress + 1

Question 43

✓
IF NewAddress > 99 THEN NewAddress 0

Question 44

Question 45

✓
SEEK NewAddress

Question 46

✓
GETRECORD "MembershipFile", CurrentRecord
✓
47 ENDWHILE
✓
[max. 4]

Mark scheme 9608_w15_ms_41.pdf →

Topic relevance

Why this question appears here

71% assigned-topic match · Programming › Constructs

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

Keep practising this topic