Lesson Overview
This lesson plan provides an outline for teaching a Flocabulary computer science unit on conditional statements. It was developed as part of a collaboration with Code.org in celebration of CSEd Week.
Lesson Summary
Duration: 50-120 mins
Getting Started: (10-20 mins)
Activity (20-45 mins)
Wrap-Up: (5-10 mins)
Assessment/Extended Learning (15-45 mins)
- Optional: Assessment if Access
- Optional: Watch Video on Computer Programming
- Optional: Connect Concept to ELA by Writing Choose Your Own Adventure Stories
Audience
This lesson plan is intended for use with students in grades 5-12.
Learning Objectives:
Students will:
- understand that all coding languages use common concepts like conditionals.
- understand that conditionals are statements that are carried out when certain criteria are met.
- evaluate a conditional statement and predict the outcome, given an input.
- write conditional statements, defining criteria for when a program should take certain actions.
Materials, Resources and Preparation
- Watch the Flocabulary Coding: Conditionals video, go through the Quick Review questions, read the Lyric Notes and review the activity worksheet and answer key.
Getting Started (10-20 minutes)
Introduce the lesson
Explain to students that coding means writing in a language that a computer can understand and use to carry out tasks. There are many different coding languages, also called programming languages, but all languages are written using common concepts. One of these is the concept of conditional statements, which allow a program to take different actions depending on whether certain criteria are met.
Video
- Play the Coding: Conditionals video once. Play it again, and pause it each time a flowchart appears onscreen to walk through the conditional statement. When paused on the first flowchart for the real-life example of helping out with a chore (at 1:19), ask the class:
- What is the if condition?
- What happens if the if condition is true?
- What happens if the if condition is false?
- When paused on the second flowchart for the game example (at 3:10), ask the class:
- What is the if condition?
- What happens if the if condition is true?
- What happens if the if condition is false?
- What is the else if condition?
- What happens if the else if condition is true?
- What happens if the else if condition is false?
Activity (30-60 minutes)
The length of this section will vary depending on how much time you spend as a class discussing the Lyric Notes and exploring the online activity from the worksheet.
Quick Review Questions and Lyric Notes
- As a class, answer the quick review questions. You can also make this into a game by dividing the class into teams and having each team write down the answers.
- Print out the Lyric Notes and have students read them and take notes and write questions in the space provided. Come back together as a class to discuss students’ thoughts and questions. Alternately, you can read the Lyric Notes as a class.
Activity Worksheet
- Print out and have students complete the activity worksheet. This is a sequence of four exercises that students can complete individually or in small groups. The exercise sequence begins with suggestions for the educator for reviewing key vocabulary from the unit and demonstrating the concept of conditionals with the class.
- The first three parts of the worksheet will be done on paper, and part 4 includes an online activity on Code.org. Students will write conditionals related to their everyday lives and draw flowcharts to represent them, write conditionals to reflect given scenarios, and determine the outcomes of conditional statements, given certain inputs. In Part 4, students will to go Code.org to complete the Bee Conditionals activity and return to the worksheet to flesh out a conditional that they created there.
Wrap-Up (5-10 mins)
Debrief and Close
- Have students check their answers to Parts 2 and 3 of the activity worksheet.
- Have students do a “think-pair-share” to share the conditional statements they wrote in Parts 1, 2 and 4 with a partner.
- Have students discuss or write on the questions: What did they learn today? What do they still want to learn? Can they come up with a scenario in a program, whether a website, app or game, where conditionals would be used?
Assessment/Extended Learning: (15-45 mins)
(Optional)
- If you have access to the unit quiz, have students take it online or on paper.
- Explain to students that coding is one step in the process of computer programming. Watch the Flocabulary Computer Programming video to learn more about the five steps in the process.
- Connect the concept of conditionals to ELA by having students write Choose Your Own Adventure stories with an “if, else if, else” structure! Introduce the genre of Choose Your Own Adventure stories to the class, and show an example if you’d like. Discuss the attributes of Choose Your Own Adventure stories, and explain how the author uses the second person point of view to make the reader a character in the story: “You walk down the road. You spot a shadow moving in the distance. Your heart pounds.” At certain points in the story, the reader is prompted to make a decision about which action to take, determining the plot of the story: “Choice: do you continue on the road to see what’s creating the shadow? (turn to page 2) Or, do you turn back? (turn to page 3).”
- Explain how Choose Your Own Adventure stories are similar to conditional statements in computer programming. In a CYoA story, the story can go down different paths, depending on the choice the reader makes. Similarly, conditionals allow a program to branch and go down different paths, depending on whether a condition evaluates to true or false.
- Tell students that they’re going to write Choose Your Own Adventure stories using the “if, else if, else” structure of a conditional statement. Watch the Flocabulary video on Plot Elements, and if you’d like, on Point of View to review the second person perspective. Review the elements of a plot: the introduction, rising action, climax, falling action and conclusion.
- Divide students in groups of three, and have them plot out a Choose Your Own Adventure story by filling in the Graphic Organizer. Together, the group will decide on the setting and characters and write notes about the introduction and rising action of the story.
- Then, each group member will be in charge of creating a different path for the story to continue down. One group member will each take the “if,” “else if” and “else” branches. For the “if” and “else if” branches, the student will come up with the choice the reader will make at that point (e.g. continuing down a road, turning back, deciding to explore a nearby cave) and then the climax that will happen if the reader chooses that path. (A reader choosing the “if” or “else if” path in the story is analogous to the “if condition” or “else if condition” evaluating to true in a conditional.)
- For the “else” branch, there will be no choice since the “else” in a conditional statement has no “condition” — the else action is carried out when the if and else if conditions both turn out false. Instead, the student filling out the “else” branch will write only a climax. Encourage students to make this “else” climax an event that happens passively to the reader, such as a sudden storm or the appearance of a monster. Students will share the notes for their branches with the rest of the group and fill in their group members' notes on their sheet.
- They’ll then each continue the story further by each coming up with “if,” “else if” and “else” branches to follow from each possible climax. Each student writes a version of falling action and conclusion to follow each climax, creating a total of nine possible endings to the story. Again, the “if” and “else if” branches will include a choice, while the “else” branch will only include the falling action and conclusion. Encourage students to switch up who will work on the “if,” “else if” and “else” branches so that they’re each working on a different one than they did for the climax. Students will share the notes for their branches with the rest of the group and fill in their group members' notes on their sheet.
- Students should each pick one branch of the story — from introduction to conclusion — and write out the story with more details on a separate sheet.