Nested Selection and Iteration Flashcards

1️⃣ Familiarise yourself with the flashcards:

  • Look through all the flashcards to see what's on both sides.
  • Make sure you understand the information on each card. If something's unclear, click the link to the revision notes at the bottom of the page for more details.

2️⃣ Test yourself:

  • Look at the question or prompt on each card and try to remember the answer before flipping it over.
  • Check the answer and make a note of any cards you find challenging and need to go over more.

3️⃣ Consistently Review and Practice:

  • Use spaced repetition: spend more time on the cards you struggle with and go over them more often.
  • Regularly review all the flashcards to help you better understand and retain the information over time.

Note: We may include questions that have multiple correct answers. It's useful to remember specific examples to understand these concepts better.

PERSONALISED 1-TO-1 TUTORING

Need more help on this topic? Get 1-to-1 support

Get support with clear explanations, practice and feedback (Ages 5 to 16).

  • DBS-checked tutors
  • Flexible times
  • Parents can be updated

Want an ad-free experience? Subscribe to remove ads

What does nesting mean in programming?

Putting an IF or a loop inside another IF or loop.

What is nested selection?

An IF inside another IF, or inside an ELSE.

What is nested iteration?

A loop inside another loop.

When should you use nested selection?

When you only want to do a second check after the first is true.

Give one common use for nested loops.

To work through rows and columns in a grid or table.

In nested loops, which counter changes fastest?

The inner loop counter. It runs fully for each outer step.

If the outer loop runs 3 times and the inner loop runs 4 times, how many inner runs happen in total?

12, because 3 times 4 equals 12.

If the inner loop stops early, what happens to the outer loop?

The inner loop ends, but the outer loop carries on with its next turn.

If an outer IF condition is false, does the inner IF run?

No. The inner IF is skipped because it is inside the outer block.

Why is indentation important with nested IFs and loops?

It shows what is inside each block and makes the flow clear.

How is an ELSE IF chain different from nested IFs?

ELSE IF checks a new condition after the first fails. Nested IFs check a new rule only if the first passes.

What changes if you swap the order of two nested loops?

The processing order changes. Different items are visited first, which can change the output.