Question 8(c) 2015 · October-November · Paper 42 · 14 marks
Reveal official mark-scheme answer
The answer for this question is in the official mark scheme: open the mark scheme.
Show text version of question
Question 8
Part (c)
Question 8
: : 1999 2000
(ii)
Another procedure call is made: Add("Drive", "Laufwerk")
Explain the problem that occurs when this key-value pair is saved.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
......................................................................................................................................
Question 10
(iii)
Describe a method to handle the problem identified in part (b)(ii).
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[2]
(iv)
Write pseudocode to implement the method you described in part
Part (b)
(iii)
. Choose line
numbers to indicate where your pseudocode should be inserted in the given pseudocode.
10 PROCEDURE Add(NewKey : STRING, NewValue : STRING)
20 Index ← Hash(NewKey)
30 Dictionary[Index, 1] ← NewKey // store the key
40 Dictionary[Index, 2] ← NewValue // store the value
50 ENDPROCEDURE
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
......................................................................................................................................
Question 11
Question 5 begins on page 12.
Question 12
5 The table shows assembly language instructions for a processor which has one general purpose register – the Accumulator (ACC).
Instruction Explanation Op Code Operand LDM #n Immediate addressing. Load the number n to ACC LDD <address> Direct addressing. Load the contents of the given address to ACC STO <address> Store the contents of ACC at the given address ADD <address> Add the contents of the given address to the ACC INC <register> Add 1 to the contents of the register CMP <address> Compare the contents of ACC with the contents of <address> JPN <address> Following a compare instruction, jump to <address> if the compare was False END Return control to the operating system
Part (c)
A stock report program uses a variable of type StockItem declared as follows:
DECLARE ThisStockItem : Stockitem
The program reads each record in the file StockFile in turn.
The program outputs the fields ProductCode and NumberInStock for each record.
Write pseudocode for this.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
..............................................................................................................................................
Question 16
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.
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_42.pdf
