Overview

In this lesson students spend most of their time practicing using the skills and processes they have learned about conditionals. At the conclusion of the lesson students discuss the main things they realized and still have questions about at the conclusion of this lesson.

Goals

Students will be able to:

Purpose

This lesson is students primary opportunity to get hands on with conditionals in code prior to the Make activity in the following lesson. Give students as much class time as you can to work through these. For this lesson it's recommended that you place students in pairs as a support and to encourage discussion about the challenges or concepts they're seeing. In the following lesson students are encouraged to work independently.

Getting Started (5 mins)

Remarks


Teaching Tip: There's a lot in the main activity of today's lesson. You may optionally wish to do a quick vocabulary review or address any questions that came up in the last lesson. Otherwise, give students more time to get hands on with some code.


Activity (35 mins)

Group: It is recommended that students work in pairs for this lesson and a number of the activities feature discussion prompts. Consider using pair programming, having drivers and navigators switch every 3 minutes, not every project.

Open a Project: Direct students to open the Lesson7_App1 project. Students will start with this project, then move through each Lesson7 project until they finish with Lesson7_App9. Before students start, briefly remind them about debugging skills that they will be using in today's activity.

Remarks

Projects 1-3: These levels only use the output command which prints commands in the debug console. Here are a few things to keep an eye out for:


Teaching Tip: Circulate around the room through the lesson encouraging students to use the strategies introduced at the beginning of the lesson. Students have a number of supports at their fingertips, so a big part of your role is helping build their independence in using those resources.


Projects 4-8: These levels practice if-statements while working with a star color-changing app.

Project 9: This two-part project returns to the "Can I Adopt a Cat?" flowchart from the Conditionals Explore activity. Students will use the flowchart to work out the logic of the if-statements in a their program.

Extension Opportunities:

Wrap Up (5 mins)

Prompt: What aspects of working with conditionals do you feel like clicked today? What do you still feel like you have trouble with?

Discussion Goal: Use this opportunity to address any lingering questions or misconceptions in the room. You can also use this as a source of discussion topics to kick off the following lesson. As you lead the discussion, call out the many resources students have access to help when they're getting stuck.


Remarks

Assessment: Check for Understanding - AP Practice

AP Reference: The questions below reflect how questions will be represented on the AP exam. You can use the AP CSP Reference Sheet and Quorum Info resource to see more about how the exam is presented and the differences between Quorum and the reference language.

Question: What will be displayed afer this code segment is run?

IF (lives = 0)
{
    DISPLAY("You Lose!")
}
ELSE
{
    IF ((score >= 5) AND (lives = 3))
    {
        DISPLAY("Perfect Game!")
    }
    ELSE
    {
        DISPLAY("You Win!")
    }
}
  1. Perfect Game!
  2. You Win!
  3. You Lose!
  4. Nothing will be displayed

Question: The program below asks a user to type in a number and then will output a message. What number will a user need to input for the message "COLD" to be displayed?

number <- INPUT()

IF (number >= 10)
{
    IF (number <= 20)
    {
        DISPLAY("MEDIUM")
    }
    ELSE
    {
        DISPLAY("HOT")
    }
}
ELSE
{
    DISPLAY("COLD")
}
  1. 5
  2. 10
  3. 15
  4. 20

Standards Alignment