Past-paper question · 2018 October-November · Paper 43 · Q2(c)

Question 2(c) 2018 · October-November · Paper 43 · 8 marks

Original past-paper question for 2(C)
Original past-paper question for 2(C)
Original past-paper question for 2(C)
Original past-paper question for 2(C)
Original past-paper question for 2(C)
Reveal official mark-scheme answer Official mark-scheme answer for 2(C)Official mark-scheme answer for 2(C)

Official answer for Question 2

Part (c)

Question 1

mark per bullet point to max 8:

Question 8

✓
•
✓
Procedure FindBook declaration and prompt and input ISBN
✓
•
✓
Validate data input has 13 characters
✓
•
✓
« and are all numeric
✓
•
✓
..loop until valid
✓
•
✓
Call Hash() with input data and store return data
✓
•
✓
Open MyBooks.dat for reading as random file and close
✓
•
✓
Finding the record using return value Hash()
✓
•
✓
Get the data for the record
✓
•
✓
«store in variable of type Book
✓
•
✓
«output all the data for the record
✓
9608/43
✓
Cambridge International AS/A Level – Mark Scheme
✓
October/November 2018
✓
PUBLISHED
✓
Question
✓
Answer
✓
Marks

Mark scheme 9608_w18_ms_43.pdf →

Show text version of question

Question 2

Part (c)

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

A
13-digit code that uniquely identifies 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 (c)

The random access file, MyBooks.dat, stores the data about the books in the format:

<Title> <Author> <ISBN> <Fiction> <LastRead>

A
procedure, FindBook():
  • prompts the user to input the ISBN of a book until the ISBN contains 13 numeric digits
  • uses the function Hash() to calculate the disk address of the record
  • reads the record for that book from MyBooks.dat into a variable of type Book
  • outputs all the data about the book.

Use pseudocode to write the procedure FindBook().

You can assume that the record exists at the disk address generated.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Question 7

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

...............................................................................................................................................[8]

Question 8

Topic relevance

Why this question appears here

82% 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_w18_qp_43.pdf

Keep practising this topic