Question 6(a) 2018 · October-November · Paper 31 · 3 marks
Reveal official mark-scheme answer
Official answer for Question 6
Part (a)
Question 1
mark for each correct row
Question 3
Question 60
Question 1
Question 61
Question 62
Question 63
Question 12
Question 64
Show text version of question
Question 6
Part (a)
Question 6
The compilation process has a number of stages. The first stage is lexical analysis.
- Tokens for keywords are shown in hexadecimal.
- All of the keyword tokens are in the range 00 – 5F.
Keyword Token 01 * 02 = 03
IF 4A THEN 4B ENDIF 4C ELSE 4D FOR 4E STEP 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 code.
Start 1 INPUT Number // Output values in a loop FOR Counter Start TO 12 OUTPUT Number * Counter ENDFOR
Question 13
Part (a)
Complete the symbol table to show its contents after the lexical analysis stage.
Token Symbol Value Type
Start 60 Variable
1 61 Constant
Why this question appears here
71% 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_31.pdf
