Skip to content
Computer Science · 6th Year

Active learning ideas

Variables and Data

Variables and data are the 'memory' of a program. In 6th Year, students learn to use variables to store information that can change, such as scores, timers, or player names. This topic is a direct application of the Algebra strand in the NCCA Mathematics curriculum, where students work with variables and unknown quantities. It moves them from static programs to dynamic, interactive experiences.

NCCA Curriculum SpecificationsPrimary Mathematics Curriculum (2023) - Algebra: VariablesDigital Learning Framework - Domain 2: Learner Experiences
15–40 minPairs → Whole Class3 activities

Activity 01

Simulation Game20 min · Whole Class

Simulation Game: The Variable Cup

Use physical cups labeled with variable names (e.g., 'Score', 'Lives'). Students act out a game where they add or remove counters from the cups based on 'events' called out by the teacher, demonstrating how data is stored and updated.

What is a variable?
ApplyAnalyzeEvaluateCreateSocial AwarenessDecision-Making
Generate Complete Lesson

Activity 02

Inquiry Circle40 min · Small Groups

Inquiry Circle: Game Design

Groups design a simple board game that requires a variable (like a 'Gold' count). They must write the 'code' for when the variable increases or decreases and test it with other groups to see if the logic holds up.

How can a game keep track of a score?
AnalyzeEvaluateCreateSelf-ManagementSelf-Awareness
Generate Complete Lesson

Activity 03

Think-Pair-Share15 min · Pairs

Think-Pair-Share: Variable Naming

Students are given a list of data points (a player's height, the current temperature, a dog's name). They must work in pairs to come up with the best variable names for these, discussing why 'temp' is better than 'x'.

Why do variables change?
UnderstandApplyAnalyzeSelf-AwarenessRelationship Skills
Generate Complete Lesson

A few notes on teaching this unit


Watch Out for These Misconceptions

  • A variable can hold many different values at the same time.

    Students often think a variable is like a list. Use the 'Variable Cup' activity to show that when you put a new value in, the old one is 'thrown away' or replaced, unless you are adding to it.

  • Variables are only for numbers.

    Students may not realise variables can store words (strings). Use hands-on modeling with name tags to show how a 'PlayerName' variable can make a game feel personal by greeting the user.


Methods used in this brief