Question 1

AQA Computer Science June 2017 Paper 1A level5 marks

On the specification

1.1
4.4 Theory of computation
1.2
4.4 Theory of computation
Question text

1 In a particular programming language, the correct syntax for a real number, natural number and digit is defined by the syntax diagrams in Figure 1. Figure 1 1.1 Write Yes or No in the unshaded cells in Table 1 to identify whether or not the numbers listed in the table are valid real numbers which conform to the correct syntax for this language. [3 marks] Table 1 Real number Valid? (Yes/No) 87.000 97+12 12.31E+12 Copy the contents of the unshaded cells in Table 1 into the table in your Electronic Answer document. 1.2 In Backus-Naur Form (BNF) the following production rule has been written to define a digit: <digit> ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 Write a BNF production rule to define a natural number that is equivalent to the definition in the syntax diagram in Figure 1. [2 marks]