Question 6(a)(ii) 2019 · October-November · Paper 23 · 8 marks
Reveal official mark-scheme answer
Official answer for Question 6
Part (a)
(ii)
Question 8
Show text version of question
Question 6
Part (a)
(ii)
Question 6
A text file, Library.txt, stores information relating to a book collection. The file stores four
pieces of information about each book on separate lines of the file, as follows:
Line n: <Book Title> Line n + 1: <Author Name> Line n + 2: <ISBN> Line n + 3: <Location>
Information is stored as data strings.
Information relating to two books is shown:
File line Data 100 "Learning Python"
101 "Brian Smith"
103 "BD345"
104 "Surviving in the mountains"
105 "C T Snow"
107 "ZX001"
(ii)
Function FindBooksBy() will:
- receive the Author Name as a parameter
- search Library.txt for matching entries
- store the Book Title and Location of matching entries in the Result array
- return an integer value giving the number of books by the author that were found.
Question 13
Write program code for the function FindBooksBy().
Visual Basic and Pascal: You should include the declaration statements for variables. Python: You should show a comment statement for each variable used with its data type.
Programming language .....................................................................................................
Program code
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
Question 14
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.....................................................................................................................................
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_w19_qp_23.pdf
