# 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"… **Computer Science** | **Grade 7** *A free lesson plan from K12 Academics. Source page: https://lessonplans.k12academics.com/k12-lesson-g7-cs-conditionals.html* 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. **Copy link** works with Canvas, Schoology, Moodle and any other LMS — paste it in as a resource or assignment. ## 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. How does a program decide what to do? ## Conditionals Project each one and have students answer about conditionals. ## 50 minutes, five moves Tap any phase to open the teacher moves and student actions. ### Hook — Making Choices 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. ### Use — Conditionals 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. ### Modify — Try It Students practice. #### 👩‍🏫 Teacher Moves - Write a simple if. - Add an else. - Change the condition. #### 🎒 Student Actions - If. - Else. - Change. ### Create — Create Students apply. #### 👩‍🏫 Teacher Moves - Write a conditional program. - Test both branches. - Explain what it does. #### 🎒 Student Actions - Write. - Test. - Explain. ### Reflect — Reflect 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. ## Built to the standards you report on Aligned to the CSTA K-12 Computer Science Standards and the ISTE Standards for Students. Use conditionals to control program flow. Create variables for conditions. Test and debug conditionals. Reason about decisions in code. ## One lesson, every learner ### Multilingual Learners - If/else sentence frames. - Frame: "if ___, then ___." - Use real examples. ### Support & Access - Write one if. - Use a template. - Use examples. ### Stretch & Extend - Add elif branches. - Combine with and/or. - Nest conditionals. ### What to gather - 📽️Screen / board - 🔀Condition cards - 💻Conditionals - 💻Code editor - 📓Notebooks - 🎫Exit-ticket slips ### Key terms - **conditional**: code that makes a decision - **if statement**: runs code when true - **else**: runs when the if is false - **condition**: a true/false test - **branch**: a path the code can take - **true/false**: the two Boolean values - **comparison**: like > or == - **flow**: the order code runs ## Exit Ticket Preview the three formative checks. Tap “Sample answer” to see what mastery looks like — hide them before you print for students. ### Reflect: conditionals. Have students write a program using if and else. A printable conditionals sheet is in the CS library. ## Check your understanding **1. What does “conditional” mean?** - runs when the if is false - like > or == - runs code when true - code that makes a decision *(correct)* “conditional” means: code that makes a decision **2. Which word means: “runs code when true”?** - if statement *(correct)* - flow - condition - comparison “if statement” means: runs code when true **3. What does “else” mean?** - code that makes a decision - runs when the if is false *(correct)* - a path the code can take - runs code when true “else” means: runs when the if is false **4. Which word means: “a true/false test”?** - condition *(correct)* - if statement - else - true/false “condition” means: a true/false test **5. What does “branch” mean?** - the order code runs - a path the code can take *(correct)* - like > or == - a true/false test “branch” means: a path the code can take **6. Which word means: “the two Boolean values”?** - if statement - comparison - branch - true/false *(correct)* “true/false” means: the two Boolean values ## Printable worksheet --- Full lesson page: https://lessonplans.k12academics.com/k12-lesson-g7-cs-conditionals.html All lessons: https://lessonplans.k12academics.com/