AP CSP CodeX - Algorithms Lesson 1

Algorithms Lesson 1 Lesson Plan

Algorithms Lesson 1

Students follow sequential robot code on a grid and decide which algorithm gets the robot to the right result.

⏰ 45 min 🎯 Grades 9-12 πŸ“„ Unplugged
View Lesson Outline
πŸ“‹

Overview

This is an unplugged lesson, so students do not use computers. Working in partners or groups of three, students follow robot code made only of sequential statements and work out where the robot ends up on a grid. The AP CSP multiple choice exam includes questions about robot code, and this first lesson introduces how to read it. Students work through seven code segments in the Activity Guide, choosing the algorithms that get the robot to the correct result.

🎯 Mission Goal: Students will determine the result of code segments.

🎯

Learning Targets

  • I can follow sequential code to control a robot.
  • I can evaluate multiple algorithms to determine which one leads to the correct result.
  • I can evaluate multiple algorithms to determine if they yield the same result.
πŸ’‘

Key Concepts

  • The AP CSP multiple choice exam will have questions that involve robot code. This first assignment introduces students to robot code using only sequential algorithms.
  • Students can make a little paper robot and label left and right to help them evaluate the code.
βœ…

Assessment Opportunities

  • Algorithms Lesson 1 Activity Guide
  • Students compare their answers with each other and an answer key
  • Daily reflection journal or Google Form, class discussion, or exit ticket
β˜‘οΈ

Success Criteria

  • Evaluate sequential segments of robot code
  • Select algorithms that accomplish the task
πŸ“

Digital Resources

🧰

Classroom Materials

  • β–ΈPrinted Activity Guide (one per group)
  • β–ΈPencil
  • β–ΈPaper to make a little paper robot
  • β–ΈOptional: sheets of paper to use as grid squares on the floor
🌍

Real-World Applications

Humans follow and use algorithms every day. Examples are:

🍳Following a recipe.
🧭Driving and navigation.
πŸ—“οΈDaily routines.
πŸ—‚οΈOrganizing and sorting.
πŸš€

Extensions & Cross-Curricular

ExtensionStudents write their own short sequential code segment on a blank grid, trade with a partner, and trace each other's code to check the result.
ExtensionStudents compare two algorithms that end on the same square and decide which one uses fewer steps. Connect this to the vocabulary word efficiency.
MathStudents describe each robot move with compass directions (north, south, east, west) and count the total number of squares the robot travels.
Lang ArtsStudents write step-by-step directions for a simple daily routine, such as making a sandwich. A partner follows the steps exactly as written to find any missing or unclear steps.
πŸ”€

Vocabulary

β–Ύ
Algorithm - A step-by-step process or set of rules for solving a problem.
Sequence - A programming structure where code runs line by line in order.
Efficiency - A measure of how much time or memory an algorithm uses as its input grows.
πŸ“

Standards

β–Ύ

CSTA Standards - Grades 9-10

3A-AP-13

CSTA Standards - Grades 11-12

3B-AP-10 3B-AP-11

AP CSP Framework

AAP-2.A - Express an algorithm that uses sequencing without using a programming language.
AAP-2.B - Represent a step-by-step algorithmic process using sequential code statements.
Computational Thinking Practice 1.D - Evaluate solution options.
Computational Thinking Practice 4.B - Determine the result of code segments.
Computational Thinking Practice 4.C - Identify and correct errors in algorithms and programs, including error discovery through testing.
πŸ“
Preparing for the Lesson
  • Print the Activity Guide for each group. This lesson works better on paper than on a computer.
  • You may want students to take notes, or give them a handout with the instructions on it for reference.
  • Have paper ready for students to make a little paper robot and label its left and right.

πŸ§‘β€πŸ«
Teacher Notes
  • This lesson is best with partners or in groups of three.
  • This lesson is better on paper than digitally. Print the assignment for each group.
  • An alternative to doing this activity on paper is to give students sheets of paper to use as squares on a grid. Lay out the squares on the floor and have one student be the robot and another student read the code. Physical activity is an excellent way to engage students and stimulate learning.
  • Students do not need a computer for this lesson.
πŸ—ΊοΈ

Lesson Outline

This outline gives one way to present the lesson.

πŸ—£οΈWarm-up

Slide 2: Start with a review of the term "algorithm". Have students share their definitions.

Slides 3-4: Algorithms are covered on the AP CSP exam. The information on slide 3 comes straight from College Board.

πŸ“–Instructions

πŸ’» Slides 5-9: Go over the instructions for the activity, and complete an example. This is part of the whole-class instructions. It is not included in the Activity Guide.

Teaching tip: You may want students to take notes, or give them a handout with the instructions on it for reference.
Teaching tip: Have students work through the example before showing slide 9, which has the answer.
✏️Robot Code Activities

Students do not need a computer for this activity; it is unplugged. Students work through the seven code segments in the Activity Guide.

Teaching tip: Students can easily confuse the robot's left and right. Have them create a little paper robot and label the left and right on the robot. Then when it is time to turn, they will turn in the correct direction. It isn't the student's left or right, but the robot's left and right.
Teaching tip: Help students remember that turning left or right doesn't mean moving. The robot just turns in the square.

βœ… The Activity Guide is complete and ready to turn in.

πŸ§‘β€πŸ€β€πŸ§‘Wrap-Up

βœ… Formative assessment:

  • Students compare their answers with each other and an answer key. You can require students to rework any missed problems.
  • Daily reflection journal or Google Form
  • Class discussion on what they learned during the activity
  • Exit ticket