AP CSP CodeX - PT Practice Lesson 4

PT Practice Lesson 4 Lesson Plan

PT Practice Lesson 4

Students remix their PT_Practice2 and PT_Practice3 programs into one program that meets the Create PT requirements.

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

Overview

Students work on computers in the CodeSpace Sandbox. This lesson is not part of a mission. Students remix their PT_Practice2 and PT_Practice3 programs to build a new program that meets the Create PT requirements: a list, and a function with a parameter, selection and iteration. They build it in steps, then brainstorm their own remix ideas and practice answering Create PT writing prompts, including three sample prompts from College Board.

🎯 Mission Goal: Students will complete a program that meets the Create PT requirements.

🎯

Learning Targets

  • I can create and use a list in a meaningful way.
  • I can create a function with a parameter, selection and iteration.
  • I can use the parameter in an if statement.
💡

Key Concepts

  • The Create PT has specific requirements for the program students create.
  • The parameter does not have to be used in an if statement, but it should have an effect on the functionality. The easiest way to do this is to use the parameter in an if statement.
✅

Assessment Opportunities

  • PT Practice Lesson 4 Activity Guide
  • Completed PT_Practice4 program
  • Wrap-up questions, including the sample College Board writing prompts
  • Optional: a writing prompt from the Create PT Writing Prompts
☑️

Success Criteria

  • Create a list
  • Use the list in a loop
  • Create a function with a parameter
  • Create a function that has a loop and if statement
📁

Digital Resources

🧰

Classroom Materials

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

Extensions & Cross-Curricular

ExtensionStudents change the function so the parameter chooses between two different results, then write the two different function calls and explain what each one does, the way a Create PT written response asks.
ExtensionStudents add a second list and use both lists in the program, then explain what each list is for.
MathStudents change the length of their list, run the game several times, and record how the length changes the results.
Lang ArtsStudents pick a prompt from the Create PT Writing Prompts and write a short response about their program.
📐

Standards

▾

CSTA Standards

The Create PT Prep unit reviews the CSTA Standards for Units 1, 2 and 3.

AP CSP Framework

CRD-2.A - Describe the purpose of a computing innovation.
CRD-2.C - Identify input(s) to a program.
CRD-2.D - Identify output(s) produced by a program.
AAP-1.D - Develop data abstraction using lists to store multiple elements.
AAP-2.H - Write conditional statements.
AAP-2.K - Write iteration statements.
AAP-2.N - Write expressions that use list indexing and list procedures.
AAP-3.A - Write statements to call procedures.
AAP-3.C - Develop procedural abstractions to manage complexity in a program by writing procedures.
📝
Preparing for the Lesson
  • Prepare the Activity Guide to give to students. It is used for notes during the lesson, brainstorming remix ideas, and the wrap-up questions.
  • Make sure students have PT_Practice2 and PT_Practice3 from earlier in this unit completed and accessible, or have the starter code ready to give them.

🧑‍🏫
Teacher Notes
  • Students complete this lesson on the computer, using the Sandbox in CodeSpace for programming. This lesson is not part of a mission.
  • Students remix PT_Practice2 and PT_Practice3 to meet the requirements of the Create PT.
  • The best experience will come from students modifying their own code. However, we want all students to be engaged, so you can give them the original code to remix if needed. PT_Practice2 and PT_Practice3 are found in lessons earlier in this unit.
  • Follow the slides for instructions and guidance. Additional help is provided in the Lesson Outline below.
  • Solution code for three intermediate steps and the final program is provided.
  • Requirements note: The function created by the student needs to have a parameter that has an effect on its functionality. This can be accomplished many ways. But students need to be able to understand how this works, and they may be asked to give two different function calls that run different parts of the function, or why it does not run different parts of the function. The wording has changed a little bit over the last couple of years. From a reader's viewpoint, the easiest way for students to be able to respond to this type of question is to use the parameter in an if statement, and for the if statement to be near the beginning of the function. All the examples in this unit will meet the requirement in this way.
🗺️

Lesson Outline

This outline gives one way to present the lesson.

🗣️Warm-up

Use a discussion strategy, like journaling, working at boards, selecting random students, or a form of think-pair-share. Slides 2-4:

  • Review the requirements for the Create Performance Task.
  • Review how the Create PT is like a remix project.
Teaching tip: The first question in the Coding section of the Activity Guide can be included in the warm-up.
💻PT Practice 4

💻 Students can work individually or with a collaborative partner.

Important: Students will refer to PT_Practice2 and PT_Practice3 from earlier lessons. They need to have them completed and accessible. Alternatively, you can give students the code as a starter from the earlier lessons.

Teaching tip: Slides 4-5: Students review the last two PT Practice programs.
Teaching tip: Slides 6-9: Students start the remix by creating a new file for the program. They create a list of letters. The letters can be in any order, and the length of the list can vary. A function with a parameter is started, and the parameter is used in an if statement. The yellow star on slide 8 indicates the solution code up to this part is included (part 1).
Teaching tip: Slides 10-14: Students add a for loop and another if statement to display the result of the game. The yellow star on slide 14 indicates the solution code up to this part is available (part 2).
Teaching tip: Slides 15-17: Students complete the main program by adding button presses. The yellow star on slide 17 indicates the solution code up to this part is available (part 3).
Teaching tip: Slides 18-21: These slides can be skipped, depending on the time left and the interests of your students. They show a good example of procedural abstraction by managing complexity. They also show what is essential for the function requirements of the Create PT, and how the non-essential code can be put into separate functions, which makes writing about the code easier. The yellow star on slide 19 indicates the solution code for the final program is available (final).
Teaching tip: Slide 22: Students return to the Activity Guide and brainstorm their own remix ideas. Alternatively, you can use collaborative groups or whole class discussion with the question.
Teaching tip: Slides 23-24: Final slides that go over information about the program they may be asked to write about in the Create PT writing prompts. The wrap-up will start to ask potential writing prompts so students can practice their responses.
🧑‍🤝‍🧑Wrap-Up

The wrap-up reviews their programming process and gives potential writing prompts. The last three questions on the wrap-up are actual sample writing prompts from College Board. If time permits, have students review each other's responses. Or select a couple responses and anonymously display them with the class and discuss if the response answers the question.

✅ Formative assessment:

  • Daily reflection or journal entry
  • Wrap-up questions
  • Completed program
  • Exit ticket
  • Optional - pull a writing prompt from the Create PT Writing Prompts and have students write about their code