Past-paper question · 2019 May-June · Paper 31 · Q4(b)

Question 4(b) 2019 · May-June · Paper 31 · 2 marks

Original past-paper question for 4(B)
Original past-paper question for 4(B)
Original past-paper question for 4(B)
Original past-paper question for 4(B)
Reveal official mark-scheme answer Official mark-scheme answer for 4(B)

Official answer for Question 4

Part (b)

Question 2

Question 60

✓
01
✓
First two cells given in question.
✓
1 mark for next 3 cells

Question 61

Question 51

Question 62

✓
1 mark for the remainder
✓
4E
✓
4A

Question 62

✓
04

Question 63

✓
4B

Question 51

Question 62

✓
4C

Question 60

✓
....
✓
01

Question 60

✓
02

Question 64

✓
4F

Question 62

✓
03

Question 63

Question 52

Question 60

✓
....

Mark scheme 9608_s19_ms_31.pdf →

Show text version of question

Question 4

Part (b)

Question 4

A compiler uses a keyword table and a symbol table. Part of the keyword table is shown.

  • Tokens for keywords are shown in hexadecimal.
  • All of the keyword tokens are in the range 00 – 5F.

Keyword Token 01 + 02 = 03 <> 04

IF 4A THEN 4B ENDIF 4C ELSE 4D REPEAT 4E UNTIL 4F TO 50 INPUT 51 OUTPUT 52 ENDFOR 53

Entries in the symbol table are allocated tokens. These values start from 60 (hexadecimal).

Study the following piece of pseudocode.

Counter 0 INPUT Password REPEAT IF Password <> "Cambridge" THEN INPUT Password ENDIF Counter Counter + 1 UNTIL Password = "Cambridge" OUTPUT Counter

Question 9

Part (b)

The output from the lexical analysis stage is stored in the following table. Each cell stores one

byte of the output.

Complete the output from the lexical analysis using the keyword table and your answer to part (a).

60 01

[2]

Question 10

Topic relevance

Why this question appears here

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

Keep practising this topic