Past-paper question · 2017 October-November · Paper 31 · Q3(b)

Question 3(b) 2017 · October-November · Paper 31 · 6 marks

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

Official answer for Question 3

Part (b)

✓
<assignment_statement> ::= <variable> :=

Question 1

Question 6

✓
<variable> <operator> <unsigned_integer>

Question 1

✓
<variable> ::= <letter> <digit>

Question 1

✓
<unsigned_integer> ::= <digit> |

Question 1

✓
<digit> <unsigned_integer>

Question 1

✓
<letter> ::= A | B | C

Question 1

✓
<operator> ::= + | - | * | ^

Mark scheme 9608_w17_ms_31.pdf →

Show text version of question

Question 3

Part (b)

Question 3

The following syntax diagrams for a particular programming language show the syntax of:

  • an assignment statement
  • a variable
  • an unsigned integer
  • a letter
  • an operator
  • a digit.

Assignment statement

Unsigned Variable := Variable Operator integer

Variable Digit Letter Digit

Question 1

Unsigned integer

Question 2

Digit

Question 3

Question 4

Letter Operator

Question 5

A
+
B
– 6
C
* 7

^ 8

Question 9

0

Question 6

Part (b)

Complete the Backus-Naur Form (BNF) for the syntax diagrams shown.

<digit> has been done for you.

<assignment_statement> ::=

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

<variable> ::=

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

<unsigned_integer> ::=

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

<digit> ::= 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0

<letter> ::=

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

<operator> ::=

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

[6]

Question 7

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

Keep practising this topic