Skip to content
Computer Science · 6th Year

Active learning ideas

Loops and Iteration

Loops and iteration introduce the concept of efficiency in programming. For 6th Year students, this is a 'lightbulb moment' where they realise they don't have to write the same command ten times. This topic connects to the Algebra strand of the NCCA Mathematics curriculum, specifically rules and properties, as students identify repeating patterns and create rules to handle them.

NCCA Curriculum SpecificationsPrimary Mathematics Curriculum (2023) - Algebra: Rules and PropertiesPrimary Curriculum Framework - Being a Digital Learner
20–45 minPairs → Whole Class3 activities

Activity 01

Formal Debate20 min · Whole Class

Formal Debate: The Efficiency Challenge

Show two versions of code that achieve the same result: one long sequence and one using a loop. Students debate which is better, considering factors like readability, speed of writing, and ease of fixing mistakes.

Why do we use loops in programming?
AnalyzeEvaluateCreateSelf-ManagementDecision-Making
Generate Complete Lesson

Activity 02

Stations Rotation45 min · Small Groups

Stations Rotation: Loop Patterns

Stations include: 1. Creating a repeating drawing (like a square) using loops. 2. Identifying loops in popular songs. 3. Writing a 'forever' loop for a school bell system. Students rotate to see loops in different contexts.

What is the difference between a 'repeat' and a 'forever' loop?
RememberUnderstandApplyAnalyzeSelf-ManagementRelationship Skills
Generate Complete Lesson

Activity 03

Inquiry Circle25 min · Pairs

Inquiry Circle: The Loop Hunt

In pairs, students look at complex physical tasks (like a person walking or a clock ticking) and identify the 'loop' and the 'exit condition' (e.g., walk until you reach the wall). They then map these as code blocks.

How do loops save time?
AnalyzeEvaluateCreateSelf-ManagementSelf-Awareness
Generate Complete Lesson

A few notes on teaching this unit


Watch Out for These Misconceptions

  • A 'forever' loop will break the computer.

    Students often fear infinite loops. Use a simulation to show that a forever loop is just a way to keep a program 'listening' for an event, like a light sensor waiting for it to get dark.

  • Loops are only for movement.

    Students may only use loops to move a sprite. Use hands-on modeling to show how loops can be used for sounds, changing colours, or checking a score constantly.


Methods used in this brief