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.
The 20 questions
-
Which of these is NOT one of the three principles used to combine statements in imperative programming?
- Inheritance
- Iteration
- Selection
- Sequence
-
Which programming construct chooses between alternative paths of execution based on a condition?
- Sequence
- Selection
- Iteration
- Subroutine
-
Which type of iteration repeats code for a count known before the loop begins?
- Nested selection
- Indefinite iteration
- Subroutine call
- Definite iteration
-
Which type of iteration repeats code based on a condition until it is met?
- Definite iteration
- Sequence
- Assignment
- Indefinite iteration
-
How many times will the body of a post-test loop run at minimum?
- Zero times
- Infinitely
- Exactly twice
- At least once
-
What structure is formed when one IF statement is placed inside another IF statement?
- Definite iteration
- Nested iteration
- Nested selection
- Subroutine call
-
Why is it important to use meaningful identifier names in programs?
- Reduces file size
- Increases execution speed
- Prevents syntax errors
- Improves code readability
-
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
-
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
-
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
-
sum := 0; FOR i := 1 TO 4 DO sum := sum + i END FOR. What is the final value of sum?
- 12
- 4
- 10
- 8
-
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
-
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
-
Which loop structure guarantees that a menu is displayed at least once before testing?
- Pre-test loop
- Definite loop
- For loop
- Post-test loop
-
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
-
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
-
How many times does a pre-test loop run if its condition is initially false?
- Two times
- One time
- Zero times
- Infinite times
-
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
-
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
-
Which structure represents definite iteration in programming?
- WHILE loop
- DO WHILE loop
- FOR loop
- REPEAT UNTIL loop
Related quizzes
- Data types Quiz · 4.1.1.1 · 20 questions
- Arithmetic operations Quiz · 4.1.1.3 · 20 questions
- Relational and Boolean operations Quiz · 4.1.1.4 · 20 questions
- Constants and variables Quiz · 4.1.1.6 · 20 questions
- String-handling operations Quiz · 4.1.1.7 · 20 questions
- Random numbers and exception handling Quiz · 4.1.1.8 · 20 questions
- Subroutines Quiz · 4.1.1.10 · 20 questions
- Parameters and returning values Quiz · 4.1.1.11 · 20 questions
- Local and global variables Quiz · 4.1.1.13 · 20 questions
- Stack frames in subroutine calls Quiz · 4.1.1.15 · 20 questions