Past-paper question · 2018 May-June · Paper 32 · Q2(b)

Question 2(b) 2018 · May-June · Paper 32 · 6 marks

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

Official answer for Question 2

Part (b)

Question 1

mark for each bullet

Question 6

✓
assignment:
  • <variable> = <variable><operator><variable>;
✓
variable:
  • <letter>|
  • <letter><unsigned integer>
✓
unsigned integer:
  • <digit>|
  • <digit><unsigned integer>
✓
operator:
  • + | - | * | /
✓
<assignment statement> ::= <variable> =
✓
<variable><operator><variable>;
✓
<variable> ::= <letter> | <letter><unsigned integer>
✓
<unsigned integer> ::= <digit> | <digit><unsigned integer>
✓
<operator> ::= + | - | * | /

Mark scheme 9608_s18_ms_32.pdf →

Show text version of question

Question 2

Part (b)

Question 2

The following syntax diagrams show the syntax of:

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

assignment statement variable = variable operator variable ;

variable letter unsigned integer

unsigned integer digit

letter A

B

C

digit operator 1 +

2 -

3 *

4 /

Question 5

Question 5

Part (b)

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

<assignment statement> ::=

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

<variable> ::=

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

<unsigned integer> ::=

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

<operator> ::=

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

[6]

Question 6

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

Keep practising this topic