Overview

Students practice traversing lists, filtering and reducing lists, and using the data import tools. Along the way students develop debugging practices with traversals.

Goals

Students will be able to:

Purpose

This lesson is students primary opportunity to get hands on with lists 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.

Getting Started (0 mins)

Remarks


Teaching Tip

Move Quickly to the Activity: 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.

Remarks

Open a Project: Today's lesson has students investigate 7 different apps. Direct students to begin with Lesson11_App1.

Apps 1-3 Traversal Practice: These apps have students perform simple traversals over lists that are created inside their code (not by importing data from a file). In each program sample code is provided which students can use to help writing the code of their own.

Apps 4-6 Reduce and Filter Practice: Students practice the reduce and filter patterns introduced in the previous lesson. In each program sample code is provided which students can use to help writing the code of their own.

App 7 App Practice: In this level, students use the reduce pattern to finish building an app.


Teaching Tip

Providing Support: 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.


Wrap Up

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

Discuss: Have students share with one another before sharing with the whole class.

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

Question: What is stored in studentScores after running this program code?

studentScores <- [77, 32, 45, 92, 86]

FOR EACH item IN studentScores
{
    IF (item > 60)
    {
        item <- item + 5
    }
    ELSE
    {
        item <- 0
    }
}

Standards Alignment