Lesson 4.1.1.2

4.1.1.2 Programming concepts: sequence, selection and iteration Quiz: AQA Computer Science, Unit 1

20 questions

In partnership with Revision Ninja

Lesson 4.1.1.2, Programming concepts: sequence, selection and iteration: 20 multiple choice questions for the AQA Computer Science (7517), Unit 1: Fundamentals of programming, 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. Which of these is NOT one of the three principles used to combine statements in imperative programming?

    • Inheritance
    • Iteration
    • Selection
    • Sequence
  2. Which programming construct chooses between alternative paths of execution based on a condition?

    • Sequence
    • Selection
    • Iteration
    • Subroutine
  3. Which type of iteration repeats code for a count known before the loop begins?

    • Nested selection
    • Indefinite iteration
    • Subroutine call
    • Definite iteration
  4. Which type of iteration repeats code based on a condition until it is met?

    • Definite iteration
    • Sequence
    • Assignment
    • Indefinite iteration
  5. How many times will the body of a post-test loop run at minimum?

    • Zero times
    • Infinitely
    • Exactly twice
    • At least once
  6. What structure is formed when one IF statement is placed inside another IF statement?

    • Definite iteration
    • Nested iteration
    • Nested selection
    • Subroutine call
  7. Why is it important to use meaningful identifier names in programs?

    • Reduces file size
    • Increases execution speed
    • Prevents syntax errors
    • Improves code readability
  8. Trace the code: x := 0; WHILE x < 3 DO x := x + 1 END WHILE. What is the final value of x?

    • 4
    • 3
    • 0
    • 2
  9. A REPEAT ... UNTIL loop sets count to 5, then the body decrements count by 1, and the loop ends when count = 0. How many times does the body run?

    • 1
    • 4
    • 6
    • 5
  10. A WHILE loop tests the condition at the start, and the condition is false before the first iteration. How many times does the body run?

    • 1
    • 0
    • It runs forever
    • 2
  11. sum := 0; FOR i := 1 TO 4 DO sum := sum + i END FOR. What is the final value of sum?

    • 12
    • 4
    • 10
    • 8
  12. A FOR loop runs i from 1 to 3 and, inside it, a nested FOR loop runs j from 1 to 2. How many times does the innermost body run?

    • 3
    • 9
    • 6
    • 5
  13. A program sets score to 49 and runs: IF score >= 50 THEN output pass ELSE output fail END IF. What is output?

    • 49
    • pass
    • fail
    • neither
  14. Which loop structure guarantees that a menu is displayed at least once before testing?

    • Pre-test loop
    • Definite loop
    • For loop
    • Post-test loop
  15. A FOR loop counts i from 10 down to 1 in steps of 3, so i takes the values 10, 7, 4 and 1. How many iterations are there?

    • 10
    • 5
    • 3
    • 4
  16. Which type of iteration is used when the number of repeats depends on a sentinel value?

    • Definite iteration
    • Count-controlled iteration
    • Nested iteration
    • Indefinite iteration
  17. How many times does a pre-test loop run if its condition is initially false?

    • Two times
    • One time
    • Zero times
    • Infinite times
  18. A program runs: x := 15; IF x > 10 THEN IF x > 20 THEN output high ELSE output mid END IF ELSE output low END IF. What is output?

    • low
    • high
    • mid
    • nothing
  19. A nested loop processes a grid with 4 rows and 5 columns, visiting every cell once. How many cells are visited in total?

    • 1024
    • 20
    • 25
    • 9
  20. Which structure represents definite iteration in programming?

    • WHILE loop
    • DO WHILE loop
    • FOR loop
    • REPEAT UNTIL loop

All AQA Computer Science quizzes