Skip to content
Control Structures: Selection
Coding · 1st Year · Programming Fundamentals · 3.º Período

Control Structures: Selection

Use conditional statements to allow programmes to make decisions based on user input or data.

TL;DR:Selection is how programs make decisions. Using 'if-then-else' logic, students can create programs that respond differently depending on the situation. This is a fundamental concept in NCCA Strand 3, allowing for interactivity and complexity in coding projects.

NCCA Curriculum SpecificationsNCCA Coding Strand 2: 2.8NCCA Coding Strand 3: 3.3

About This Topic

Selection is how programs make decisions. Using 'if-then-else' logic, students can create programs that respond differently depending on the situation. This is a fundamental concept in NCCA Strand 3, allowing for interactivity and complexity in coding projects.

Whether it is a game character losing a life if their health hits zero, or a website showing a 'Welcome' message only if a user is logged in, selection is everywhere. This topic is best explored through active learning, as it allows students to 'act out' the logic and see the branching paths of a program. Students grasp this concept faster through structured discussion and peer explanation of their decision-making logic.

Key Questions

  1. How do computers make decisions?
  2. What is a conditional statement?
  3. How can selection change the flow of a programme?

Watch Out for These Misconceptions

Common MisconceptionThe 'else' part is always required.

What to Teach Instead

Students often think every 'if' needs an 'else'. Using a simple 'If it's Tuesday, we have PE' example shows that sometimes, if the condition isn't met, the program just does nothing and moves on.

Common MisconceptionComputers can 'guess' what you mean if the condition is vague.

What to Teach Instead

Computers need exact conditions (e.g., 'Score > 10' not 'Score is high'). A 'literal robot' activity where students give vague instructions helps them see why precision in selection is vital.

Active Learning Ideas

See all activities

Frequently Asked Questions

What is 'selection' in programming?
Selection is just a fancy word for making a choice. In code, we use 'If' statements to tell the computer to check a condition. If the condition is true, it does one thing; if it is false, it can do something else (the 'Else' part).
How does this topic relate to the NCCA Coding Strand 3?
Selection is a core programming construct required by Learning Outcome 3.3. It moves students from writing simple linear scripts to creating dynamic programs that can react to user input, which is essential for building games or useful apps.
What are the best hands-on strategies for teaching selection?
Role-playing is the most effective way to teach selection. When students have to act as the 'processor' and make decisions based on strict rules, they quickly understand how 'if-then-else' logic works. 'Choose Your Own Adventure' stories are also excellent because they visually and narratively represent the branching paths of selection logic.
Is selection the same as a loop?
No, and students often confuse them. Selection happens once: the computer checks a condition and moves on. A loop repeats a task. Using a 'one-time check' versus a 'repeat' physical activity can help clarify this difference.
Edited by Adriana Perusin, Editor-in-Chief, Flip Education