AP CSP CodeX - From Code to Flowcharts

Unit 2 Lesson Plan

From Code to Flowcharts

Students label the four basic flowchart symbols and create flowcharts that visualize Python code.

⏰ 45 min 🎯 Grades 9-12 💻 CodeSpace 🎮 CodeX 🐍 Python
View Lesson Outline
📋

Overview

Students review the four basic flowchart symbols, then practice matching lines of Python code to those symbols. Next, they create flowcharts for four Python code segments, either by hand on the Activity Guide or with a flowchart website while using the Guided Notes. An optional challenge adds a fifth code segment.

🎯 Mission Goal: Students will create flowcharts from Python code.

🎯

Learning Targets

  • I can label the four basic symbols used in flowcharts.
  • I can make a flowchart that visualizes a process.
💡

Key Concepts

  • There are four basic flowchart symbols.
  • Each line or lines of Python code can be visualized as a flowchart symbol.
  • Sometimes it is convenient to group similar lines of Python code into a single flowchart symbol.
☑️

Success Criteria

  • Name the four basic flowchart symbols and what they are used for
  • Create a flowchart that visualizes a process from Python code
🧰

Classroom Materials

  • ▸CodeX
  • ▸USB-C cable
  • ▸Computer
🌍

Real-World Applications

Flowcharts turn complex, multi-step processes into clear visual maps that guide decisions.

🎧Customer support: Service ticketing trees map out how each agent greets users, diagnoses known bugs, or sends the ticket up the line to a senior specialist.
🏥Health care and medicine: Clinical treatment protocols help emergency staff follow precise diagnostic rules and medication rules based on patient vital signs.
👥Human resources: Onboarding procedures direct the new hire paperwork, IT equipment requests, and managerial sign-offs.
🚀

Extensions & Cross-Curricular

ExtensionStudents who finish early complete the optional challenge and create a flowchart from the fifth Python code segment.
ExtensionStudents trade flowcharts with a partner. Each partner traces the other's flowchart and checks that it matches the Python code.
MathStudents create a flowchart for a multi-step math process, such as finding the average of a set of numbers.
Lang ArtsStudents write the steps of a familiar routine, such as making a sandwich, as a numbered list. Then they turn the steps into a flowchart.
🔤

Vocabulary

▾
Flowchart - A visualization, or graphic organizer, of an algorithm. A diagram that uses shapes, lines, and arrows to sequence steps; a visual representation of the input, output, decisions, and actions that take place within a program.
Algorithm - A sequence of steps for completing a task (step by step process).
🐍

New Python Code

▾

No new Python code in this lesson.

📐

Standards

▾

CSTA Standards - Grades 9-10

3A-AP-13

CSTA Standards - Grades 11-12

3B-AP-10

AP CSP Framework

AAP-2.A - Express an algorithm that uses sequencing without using a programming language.
AAP-2.G - Express an algorithm that uses selection without using a programming language.

AP CSP Framework - Computational Thinking Practices

2.A - Represent algorithmic processes without using a programming language.
📝
Preparing for the Lesson
  • Choose the Activity Guide or the Guided Notes (you do not need both). Print the Activity Guide. Print the Guided Notes or share them digitally.
  • If students will use the Guided Notes, choose a flowchart website ahead of time. draw.io is one option.
  • Have the slides and the Flowcharts Kahoot! Review ready for the wrap-up.

🧑‍🏫
Teacher Notes
  • This lesson has two options. Select one.
  • Option 1: Print the Activity Guide and have students create flowcharts in the space provided.
  • Option 2: Print the Guided Notes. Use them for review. Then use a website for flowchart creation. Students can paste an image of their flowcharts in the Guided Notes if desired.
  • Students can work in groups of 2 or 3 and do all their work on whiteboards. Students can also work individually and use small whiteboards. Or students can use PowerPoint or Google Slides to create the flowcharts instead of drawing them.
  • There are several free websites that have tools for drawing flowcharts. draw.io lets you save charts in a Google Drive or download or export them.
  • You can choose to display the Python code on a large screen, print copies for each group, or have students use their own computers to view the code while creating flowcharts.
  • All the answer flowcharts given are just samples. Creating a flowchart is a creative process and there are many correct ways to accomplish the task. Praise the creativity of each flowchart and discuss its merits.
🗺️

Lesson Outline

🗣️Warm-up (5 minutes)

Use the slides to review flowchart symbols. Start with slides #1-4. Then show slide #5 so students can check their work.

Slide #5 symbols:

  • Oval: start or stop
  • Parallelogram: input or output
  • Rectangle: action or process
  • Diamond: decision
  • Lines and arrows: flow lines

Use either the Activity Guide or the Guided Notes (you do not need both).

  • If using the Activity Guide, it needs to be printed and distributed to students.
  • Guided Notes can either be printed or distributed digitally.
💻Activity (40 minutes)

Use slides #6-8 to introduce the activity. Take time on slides #7-8 to have students discuss which symbols correspond to Python code.

Students create flowcharts for four different Python code segments.

  • If students are using the Activity Guide, the code is on the guide. Students create their flowcharts by hand on the guide.
  • If students are using the Guided Notes, they use a website to create the flowcharts. One suggestion is draw.io. Other websites are available. You can even use Google Slides.

✅ The assignment document can also be turned in.

🚀Challenge (optional, 10 minutes)

A fifth Python code segment is given that students can use to create a flowchart.

The challenge program is very similar to Python Code #4, but it includes incrementing a variable. Students will do this in the next mission, but they haven't done it yet. You can have them do the challenge as a preview of what is to come, you can help them with it, or you can skip it altogether.

🧑‍🤝‍🧑Wrap-Up (5 minutes)

Formative assessment:

  • Daily reflection journal
  • Flowcharts Kahoot! Review
  • Exit ticket