Past-paper question · 2015 October-November · Paper 32 · Q2(a)

Question 2(a) 2015 · October-November · Paper 32 · 3 marks

Original past-paper question for 2(A)
Original past-paper question for 2(A)
Reveal official mark-scheme answer Official mark-scheme answer for 2(A)Official mark-scheme answer for 2(A)

Official answer for Question 2

Part (a)

Part (a)

✓
Token
✓
Symbol
✓
Value
✓
Type
✓
Start

Question 60

✓
Variable
✓
0.1

Question 61

✓
Constant
✓
Counter

Question 62

✓
Variable
[1]
✓
[1+1]

Question 10

Question 63

✓
Constant
✓
Mark Scheme
✓
Syllabus
✓
Paper
✓
Cambridge International A Level – October/November 2015
✓
9608

Question 32

Mark scheme 9608_w15_ms_32.pdf →

Show text version of question

Question 2

Part (a)

Question 2

In this question, you are shown pseudocode in place of a real high-level language. A compiler

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

  • Tokens for keywords are shown in hexadecimal.
  • All the keyword tokens are in the range 00 to 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 piece of code:

Start 0.1 // Output values in loop FOR Counter Start TO 10 OUTPUT Counter + Start ENDFOR

Part (a)

Complete the symbol table below to show its contents after the lexical analysis stage.

Token Symbol Value Type

Start 60 Variable

0.1 61 Constant

[3]

Question 5

Topic relevance

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_w15_qp_32.pdf

Keep practising this topic