Several syntax diagrams are shown. [Figure X.X]
- (a)State why 9K is not a valid variable for the given syntax diagrams.[1]
- (b)Complete the Backus-Naur Form (BNF) for <operator>. <operator> ::=[1]
- (c)An expression is defined as follows: • A variable is assigned to a variable followed by an operator followed by another variable. • The operator and final variable stage can be repeated as many times as necessary. Complete the syntax diagram for an expression. [Figure X.X][3]
- (d)A character can be a letter or a digit. An additional constraint has been applied to the definition of variable. It must comply with the given syntax diagram, but it will only pass validation if it has at least four characters. State one example of a valid variable.[1]
This question uses a diagram from the original paper, which isn't shown here. Open the full paper from the past papers archive to see it.
Mark scheme
Marking points from the official mark scheme (May/June 2025). The mark or mark type is shown in brackets.
- Variables must begin with a letter / not a digit
- <operator> ::= + | - | * | / | ^
- MP1 Two variable boxes added to diagram
- MP2 One operator box added to diagram and all boxes in correct order
- MP3 Connections, arrows and return loop correctly added and no additional boxes or connections
- expression variable = variable operator variable
- Answer must begin with a valid letter. It can then be followed by any number of valid digits and/or letters, as long as it is at least four characters in length.
- AC768
Write your answer and get it marked
On Oracle Prep you can write or photograph your own answer and have it marked by AI against this mark scheme, with feedback on what you missed.
Sign up free →