Several syntax diagrams are shown. [Figure 4.1]
- (a)State whether each variable is valid or invalid and give a reason for your choice in each case. 9SW Reason UWY Reason[2]
- (b)<word> contains one or more letters. Complete the Backus-Naur Form (BNF) for <word> and use this to complete the BNF for <variable>. <word> ::= <variable> ::= [3]
- (c)(i)Vehicle registrations must begin with two letters and be followed by one, two or three digits. Valid letters and digits are shown in the syntax diagrams on page 4. State an example of a valid vehicle registration.[1]
- (c)(ii)Draw a syntax diagram for a vehicle registration.[3]
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 2023). The mark or mark type is shown in brackets.
- [2] One mark per correct valid/invalid and reason combination (Max 2) 9SW – Invalid Reason - This begins with a digit and a variable must begin with a letter UWY – Valid Reason - This begins with a letter and is followed by two other letters.
- [3] One mark per mark point (Max 3) • <word> ::= <letter>| ...<word><letter> • <variable> ::= <word>|<word><digit> Example answers <word> ::= <letter>|<word><letter> <word> ::= <letter><word>|<letter> <variable> ::= <word>|<word><digit> <variable> ::= <word><digit>|<word>
- [1] Answer must be two letters followed by one, two or three digits using the letters and digits on the syntax diagram. Example answer AC768
- [3] One mark per mark point (Max 3) • always has only two letters • one, two or three digits possible • correct arrows, boxes and name of syntax diagram Example answer Vehicle registration letter letter digit digit digit
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 →