Skip to content
Computer Science · 5th Year

Active learning ideas

Loops and Iteration

Loops and iteration are the keys to efficiency in programming. In 5th Year, students learn that instead of writing the same command ten times, they can use a 'repeat' block to handle the work. This mirrors the NCCA Mathematics focus on multiplication as repeated addition and helps students identify patterns in their own logic.

NCCA Curriculum SpecificationsNCCA Primary Mathematics: Computational ThinkingDLF: Learner Experiences - Pupils reflect on their learning and use feedback
15–30 minPairs → Whole Class3 activities

Activity 01

Role Play20 min · Whole Class

Role Play: The Loop Dance

Students create a short dance routine. Instead of writing every move, they use 'repeat' cards (e.g., 'Repeat 3: Clap, Stomp'). A 'leader' holds up the cards and the class must follow the loop correctly.

Why do we use loops in coding?
ApplyAnalyzeEvaluateSocial AwarenessSelf-Awareness
Generate Complete Lesson

Activity 02

Inquiry Circle30 min · Small Groups

Inquiry Circle: Code Shortener

Provide groups with a very long, repetitive script (e.g., move 10, wait 1, move 10, wait 1...). Their challenge is to use loops to make the code as short as possible while keeping the same behavior.

What is the difference between a set loop and a continuous loop?
AnalyzeEvaluateCreateSelf-ManagementSelf-Awareness
Generate Complete Lesson

Activity 03

Think-Pair-Share15 min · Pairs

Think-Pair-Share: Forever vs. Repeat

Students discuss real-world examples of things that happen 'forever' (like the earth spinning) versus things that 'repeat' a set number of times (like a microwave timer). They share their ideas to understand when to use different loop types.

How do loops make our code shorter?
UnderstandApplyAnalyzeSelf-AwarenessRelationship Skills
Generate Complete Lesson

A few notes on teaching this unit


Watch Out for These Misconceptions

  • A 'forever' loop will break the computer.

    Students often worry that an infinite loop is an error. Through experimentation, they learn that 'forever' loops are actually essential for things like checking if a player is touching a goal in a game.

  • Loops only make code shorter, they don't change how it works.

    Pupils might not realize that loops allow for dynamic changes. Peer discussion about how a loop can use a variable (like 'repeat until score = 10') helps them see loops as powerful logic tools, not just shortcuts.


Methods used in this brief