Past-paper question · 2015 October-November · Paper 42 · Q8(b)(i)

Question 8(b)(i) 2015 · October-November · Paper 42 · 18 marks

Original past-paper question for 8(B)(I)
Original past-paper question for 8(B)(I)
Original past-paper question for 8(B)(I)
Original past-paper question for 8(B)(I)
Original past-paper question for 8(B)(I)
Reveal official mark-scheme answer

The answer for this question is in the official mark scheme: open the mark scheme.

Mark scheme 9608_w15_ms_42.pdf →

Show text version of question

Question 8

Part (b)

(i)

Question 8

: : 1999 2000

[2]

(ii)

Another procedure call is made: Add("Drive", "Laufwerk")

Explain the problem that occurs when this key-value pair is saved.

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

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

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

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

[2]

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

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

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

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

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

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

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

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

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

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

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

[4]

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 Using opcodes from the given table, write instructions to set the value at address 509 to 12.

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

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

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

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

[2]

Question 14

6 A company keeps details of its stock items in a file of records, StockFile.

Part (a)

The record fields are the ProductCode, the Price and the NumberInStock.

Write the program code to declare the record structure StockItem.

Programming language ............................................................................................................

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

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

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

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

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

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

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

[4]

Part (b)

Before records can be read from file StockFile, the file needs to be opened.

(i)

Complete the pseudocode.

01 TRY

02 OPENFILE ...........................................................................................................

03 EXCEPT

04 ..............................................................................................................................

05 ENDTRY

[2]
Topic relevance

Why this question appears here

99% assigned-topic match · Processor fundamentals › Assembly language

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

Keep practising this topic