Skip to content
Conditionals and Selection
Computer Science · 5th Year · Programming and Coding Fundamentals · 2.º Período

Conditionals and Selection

Pupils introduce decision-making into their programmes using 'if-then' and 'if-then-else' statements. They create programmes that respond differently based on user input or events.

TL;DR:Conditionals and selection introduce decision-making to the world of coding. For 5th Year students, this is where their programs start to feel 'smart.' By using 'if-then' and 'if-then-else' blocks, students can create code that reacts to the environment, such as a character saying 'Ouch!' only when it hits a wall. This aligns with the NCCA's focus on logical reasoning and developing problem-solving strategies.

NCCA Curriculum SpecificationsNCCA Primary Mathematics: Computational ThinkingDLF: Learner Outcomes - Pupils use digital technologies to develop problem-solving strategies

About This Topic

Conditionals and selection introduce decision-making to the world of coding. For 5th Year students, this is where their programs start to feel 'smart.' By using 'if-then' and 'if-then-else' blocks, students can create code that reacts to the environment, such as a character saying 'Ouch!' only when it hits a wall. This aligns with the NCCA's focus on logical reasoning and developing problem-solving strategies.

This topic is a bridge to more advanced computational thinking, as it requires students to think about multiple possible futures for their program. It encourages 'what-if' thinking, which is valuable in science, history, and social development. Students grasp this concept faster through structured discussion and peer explanation where they debate the 'conditions' required for everyday decisions.

Key Questions

  1. How do computers make decisions?
  2. What is a conditional statement?
  3. How can we use 'if-then' blocks to create a game?

Watch Out for These Misconceptions

Common MisconceptionThe 'if' block only checks the condition once.

What to Teach Instead

In Scratch, students often forget that an 'if' block usually needs to be inside a 'forever' loop to keep checking the condition. Peer debugging helps them see why their 'if' statement didn't work when the game started.

Common MisconceptionYou can only have one 'if' at a time.

What to Teach Instead

Pupils may not realize they can stack or nest conditionals. Hands-on logic puzzles help them see how complex decisions (like 'If it's Saturday AND it's sunny') are built from simple blocks.

Active Learning Ideas

See all activities

Frequently Asked Questions

What is the difference between 'if-then' and 'if-then-else'?
'If-then' only does something if the condition is true. If it's false, nothing happens. 'If-then-else' provides an alternative action: it does one thing if the condition is true, and a different thing if it is false.
How do conditionals link to the SPHE curriculum?
Conditionals are a great way to talk about choices and consequences. You can use 'if-then' logic to map out social situations or safety rules, helping students see the logical outcomes of different behaviors.
What are 'Boolean' operators in conditionals?
These are words like AND, OR, and NOT. They allow students to create more complex conditions, like 'If score is 10 AND lives are greater than 0.' They are the 'math' of logic.
How can active learning help students understand conditionals?
Active learning turns logic into a game. By using physical 'If' cards and 'Else' actions in a classroom setting, students experience the branching nature of decision-making. It makes the concept of a 'condition' tangible rather than just a word in a block of code.
Edited by Adriana Perusin, Editor-in-Chief, Flip Education