Lesson 4.4.3.1

4.4.3.1 Backus-Naur Form and syntax diagrams Quiz: AQA Computer Science, Unit 4

20 questions

In partnership with Revision Ninja

Lesson 4.4.3.1, Backus-Naur Form and syntax diagrams: 20 multiple choice questions for the AQA Computer Science (7517), Unit 4: Theory of computation, written with Revision Ninja.

Host it live on the board and students join with a game code on their own devices, or revise alone with Free Play. The answers are revealed in the game.

Host this setFree Play

The 20 questions

  1. What is Backus-Naur Form (BNF) primarily used to describe?

    • Programming language syntax
    • Data storage capacity
    • Hardware circuit logic
    • Algorithm time complexity
  2. In Backus-Naur Form notation, what does the symbol ::= mean?

    • Is mapped to
    • Is equal to
    • Is defined as
    • Is identical to
  3. In Backus-Naur Form notation, what do angle brackets enclose?

    • Regular expressions
    • Optional comments
    • Terminal symbols
    • Non-terminal symbols
  4. What do syntax diagrams visually represent in programming languages?

    • Syntax rules
    • Memory addresses
    • Data structures
    • Execution paths
  5. Which feature allows BNF to describe languages that regular expressions cannot?

    • Alternative syntax paths
    • Finite state transitions
    • Recursive production rules
    • Terminal symbol definitions
  6. With the rule <integer> ::= <digit> | <integer><digit> and <digit> from 0 to 9, which string is a valid integer?

    • -5
    • 12a
    • an empty string
    • 2024
  7. Using the grammar <s> ::= 01 | 0<s>1, which string is generated?

    • 0101
    • 0110
    • 1100
    • 0011
  8. In the grammar <s> ::= 01 | 0<s>1, how many production steps are needed to derive 000111?

    • 4
    • 2
    • 6
    • 3
  9. Which production rule describes one or more letters?

    • <word> ::= <word>
    • <word> ::= <letter> | <word><letter>
    • <word> ::= 1
    • <word> ::= <letter>+<letter>
  10. With the rule <expr> ::= <number> | <expr>+<expr> and <number> any integer, which string is valid?

    • +1
    • 1+
    • 1 2
    • 1+2+3
  11. In Backus-Naur Form, what does a production rule specify?

    • How errors handle
    • How memory allocates
    • How code executes
    • How symbols expand
  12. In the grammar <s> ::= 01 | 0<s>1, which string cannot be generated?

    • 0110
    • 01
    • 000111
    • 0011
  13. In Backus-Naur Form, what is a terminal symbol?

    • A replaceable variable
    • A recursive function
    • A rule header
    • A final symbol
  14. A grammar generates the strings aabb, ab and so on from <s> ::= a<s>b | ab. Which string is generated?

    • abab
    • aabb
    • ba
    • aab
  15. With <p> ::= a | b | a<p>a | b<p>b, which string is generated?

    • aba
    • abb
    • aa
    • ab
  16. Which structure is best defined using BNF rather than regular expressions?

    • Lower-case character sets
    • Strings ending in 1
    • Fixed-length passcodes
    • Nested arithmetic expressions
  17. What does it mean if a context-free grammar is ambiguous?

    • No parse trees
    • Multiple parse trees
    • Syntax errors
    • Infinite loops
  18. How many characters does the string derived by applying 0<s>1 twice and then 01 contain, using <s> ::= 01 | 0<s>1?

    • 6
    • 4
    • 8
    • 5
  19. What does a backward loop in a syntax diagram represent?

    • Repetition
    • Selection
    • Sequence
    • Recursion limit
  20. Which language notation can express recursive nested structures that regular expressions cannot?

    • Finite state machines
    • Truth tables
    • Regular expressions
    • Backus-Naur Form

All AQA Computer Science quizzes