Question 10(b) 2011 · October-November · Paper 31 · 4 marks
Reveal official mark-scheme answer
Official answer for Question 10
Part (b)
Part (b)
- Only one entry and one exit point used
- Order correct (non-zero-digit, letter, digit)
- Loop around letter to create group
- Loop around digit to create two options one to include final digit, one to omit final digit
Show text version of question
Question 10
Part (b)
Question 10
A variable identifier in a certain programming language is defined in BNF (Backus-Naur For
form) as: Examiner's Use
<non-zero-digit> ::= 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 <digit> ::= 0 | <non-zero-digit> <letter> ::= A | B | C | x | y | z <group> ::= <letter> | <letter><group> <variable-identifier> ::= <non-zero-digit><group><digit> | <non-zero-digit><group>
Part (b)
Using only the terms:
- non-zero-digit
- digit
- letter
- variable-identifier
draw a syntax diagram to show the definition of a variable identifier.
reasonable effort has been made by the publisher (UCLES) to trace copyright holders, but if any items requiring clearance have unwittingly been included, the publisher will be pleased to make amends at the earliest possible opportunity.
University of Cambridge International Examinations is part of the Cambridge Assessment Group. Cambridge Assessment is the brand name of University of Cambridge Local Examinations Syndicate (UCLES), which is itself a department of the University of Cambridge.
Why this question appears here
71% assigned-topic match · Programming › Constructs
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 9691_w11_qp_31.pdf
