Question 2(b) 2018 · May-June · Paper 32 · 6 marks
Reveal official mark-scheme answer
Official answer for Question 2
Part (b)
Question 1
mark for each bullet
Question 6
- <variable> = <variable><operator><variable>;
- <letter>|
- <letter><unsigned integer>
- <digit>|
- <digit><unsigned integer>
- + | - | * | /
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> ::=
...................................................................................................................................................
Question 6
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
