Home›Lesson Plans›Computer Science›Programming · Grade 7

Conditionals (If/Else)

Seventh graders learn conditionals — if/else statements that let a program make decisions. Code inside an "if" runs only when its condition is true; "else" handles the rest. They check the ideas, then write a conditional.

Grade 7Conditionals (If / Else)50 minutes1 class periodCSTA / ISTEExplicit teaching4 StandardsCSTA
Start the Lesson
Assign or share this lesson

Copy link works with Canvas, Schoology, Moodle and any other LMS — paste it in as a resource or assignment.

Lesson at a Glance

Everything you need before the bell rings

Learning Objectives

Students will be able to…

  • ✓Use an if statement.
  • ✓Use else.
  • ✓Test a condition.
  • ✓Make code decide.
Essential Question

How does a program decide what to do?

0
Lesson Phases
0
Vocabulary Terms
0
Standards Aligned
0
Interactive Task
Check It · Interactive

Conditionals

Project each one and have students answer about conditionals.

🔀 Understand if/else conditionalsTry it
Answer each question about conditionals.
The Lesson · Explicit teaching

50 minutes, five moves

Tap any phase to open the teacher moves and student actions.

1

Hook — Making Choices

5 min

How does a game know if you won or lost?

👩‍🏫 Teacher Moves

  • Pose the question.
  • Share ideas.
  • Set the goal.

🎒 Student Actions

  • Think.
  • Share.
  • Get ready.
2

Use — Conditionals

12 min

Students learn.

👩‍🏫 Teacher Moves

  • Send students to Conditionals.
  • Note if runs when true.
  • Note else is the fallback.

🎒 Student Actions

  • Answer.
  • Note it.
  • Note it.
3

Modify — Try It

13 min

Students practice.

👩‍🏫 Teacher Moves

  • Write a simple if.
  • Add an else.
  • Change the condition.

🎒 Student Actions

  • If.
  • Else.
  • Change.
4

Create — Create

15 min

Students apply.

👩‍🏫 Teacher Moves

  • Write a conditional program.
  • Test both branches.
  • Explain what it does.

🎒 Student Actions

  • Write.
  • Test.
  • Explain.
5

Reflect — Reflect

5 min

Students close.

👩‍🏫 Teacher Moves

  • What does an if do?
  • When does else run?
  • Complete the exit ticket.

🎒 Student Actions

  • Say it.
  • Say it.
  • Complete the exit ticket.
Standards Alignment

Built to the standards you report on

Aligned to the CSTA K-12 Computer Science Standards and the ISTE Standards for Students.

CSTA
2-AP-12

Use conditionals to control program flow.

CSTA
2-AP-11

Create variables for conditions.

CSTA
2-AP-17

Test and debug conditionals.

ISTE
5c

Reason about decisions in code.

Differentiation

One lesson, every learner

Multilingual Learners

ELL / EMERGING READERS
  • If/else sentence frames.
  • Frame: "if ___, then ___."
  • Use real examples.

Support & Access

IEP / 504
  • Write one if.
  • Use a template.
  • Use examples.

Stretch & Extend

GIFTED / EARLY FINISHERS
  • Add elif branches.
  • Combine with and/or.
  • Nest conditionals.
Materials

What to gather

  • 📽️Screen / board
  • 🔀Condition cards
  • 💻Conditionals
  • 💻Code editor
  • 📓Notebooks
  • 🎫Exit-ticket slips
Vocabulary

Key terms — hover for a quick definition

conditionalcode that makes a decisionif statementruns code when trueelseruns when the if is falseconditiona true/false testbrancha path the code can taketrue/falsethe two Boolean valuescomparisonlike > or ==flowthe order code runs
Evaluate

Exit Ticket

Preview the three formative checks. Tap “Sample answer” to see what mastery looks like — hide them before you print for students.

QUESTION 1
What does an if statement let a program do?
Do different things based on a condition.
QUESTION 2
When does an else block run?
When the if condition is false.
QUESTION 3
Does if-code always run?
No — only when its condition is true.

Reflect: conditionals.

Have students write a program using if and else. A printable conditionals sheet is in the CS library.

Study · Flashcards

Study the key terms

Tap a card to flip it, then rate whether you knew it. Built from this lesson’s vocabulary.

🃏 Conditionals (If/Else)Flip
Card 1
Term
Tap to flip →
Meaning
0

Nice work!

Practice · Quiz

Check your understanding

A quick self-check with instant feedback, drawn from this lesson’s key terms.

📝 Conditionals (If/Else)Quiz
Score: 0
1 / 6
Question 1
0%

Nice work!

Practice · Worksheet

Printable worksheet

A print-and-go review sheet with a built-in answer key. Tap “Show answer key” to reveal answers, or print the clean version for students.

🖨️ Conditionals (If/Else)Print
Name: ________________________
Date: ____________

Part A · Write the word that matches each meaning

Word bank: branch, comparison, condition, conditional, else, flow, if statement, true/false
  1. runs when the if is false
  2. the two Boolean values
  3. code that makes a decision
  4. like > or ==
  5. a path the code can take
  6. runs code when true
  7. the order code runs
  8. a true/false test

Part B · Show what you learned

  1. What does an if statement let a program do?
  2. When does an else block run?
  3. Does if-code always run?
Answer key — Part A: 1) else · 2) true/false · 3) conditional · 4) comparison · 5) branch · 6) if statement · 7) flow · 8) condition
Part B: 1) Do different things based on a condition. 2) When the if condition is false. 3) No — only when its condition is true.