AP CSP CodeX - Mission 4: Display Games (Obj. 8-10) & Functions
Display Games (Obj. 8-10) & Functions
Students program CodeX buttons to get input from the user, then use if:else statements and functions to build a game.
Overview
This is the second part of Mission 4. Students finish the last objectives of Display Games, then extend their Display program with functions. The Mission 4 Obj 8-10 & Functions Assignment guides them through both parts and ends with the code they turn in.
🎯 Mission Goal: Students will program CodeX to get input from the user by pressing buttons to create a game.
Learning Targets
- I can program buttons to determine whether they are pressed.
- I can write an if:else conditional statement.
- I can create and use functions as a form of procedural abstraction.
Key Concepts
- Indenting after a colon is very important!
- Branching allows segments of code to run when a condition is True, and other segments of code to run when the condition is False.
- Functions can be used as procedural abstraction to hide details and focus on specific tasks.
Assessment Opportunities
- Mission 4 Obj 8-10 & Functions Assignment
- Display program (final through Obj. 10)
- Display_functions program
- Mission 4 Kahoot Review
Success Criteria
- Get input from pressing a button
- Use a branching if:else statement with a Boolean variable
- Create a function for each button press
- Call the functions in a specific order to create a game
Digital Resources
- ▸Mission 4 Obj 8-10 & Functions Assignment
- ▸Mission 4 Functions slides
- ▸Mission 4 Kahoot Review
- ▸Code Solutions and Assignment Answers - Teacher Dashboard > Educator Resources button
Classroom Materials
- ▸CodeX
- ▸USB-C cable
- ▸Computer
Real-World Applications
The skills used in this project are used by professional software developers to build:
Extensions & Cross-Curricular
🔤
Vocabulary
▾
🐍
New Python Code
▾
📐
Standards
▾
CSTA Standards - Grades 9-10
CSTA Standards - Grades 11-12
AP CSP Framework - Learning Objectives
AP CSP Framework - Computational Thinking Practices
- Have the Mission 4 Functions slides ready. You can show them on a big screen, or have students follow along on their computers.
- Decide whether students will work individually, keep their partner from Mission 4 Obj 1-7, or get new partners.
- If you have a word wall, or another form of vocabulary presentation, prepare the new term: procedural abstraction.
- This is the second part of Mission 4, and it includes additional instructions for creating and using procedures.
- The second half of the assignment starts after the objectives are completed. Open the slides, or have students work through the slides, to create and use functions in the program.
- Students should keep the Display program open for the second half, and save it with a new name when following the instructions on the slides.
- Students should use the Sandbox for the added instructions. However, if they stay in Mission 4 Objective 10, that is okay.
- Another suggestion for assessment is for students to keep a daily journal, or use a reflection form for students to process information they learned and reflect on questions they may still have.
- You may consider having students (or the class collectively) keep a chart of errors and the ways to fix them.
- You can also add vocabulary to a word wall and keep a document or chart of the Python code learned during each mission.
- Refer to the lesson plans in the Python with CodeX Mission Pack Curriculum for additional challenges, cross-curricular suggestions, and additional information.
Lesson Outline
This outline gives the narration for one way to present the lesson.
Use a discussion strategy, like journaling, working at boards, selecting random students, or a form of think-pair-share.
Review with students the concepts from Mission 4 completed in the last lesson:
- Assigning a value to a variable using math
- Boolean variables
- Branching
- Indenting
Students can get new partners for pair programming, or continue to work with the same partner they had with Mission 4 Obj 1-7. Or they can work individually.
If students are working with a partner, students log in to one computer. Two computers can be used if they want to have the activity guide and slides open on one computer and CodeSpace on the other computer.
Students go to make.firialabs.com and should be on Objective 8 of Mission 4.
Students continue working with a partner or individually.
The Mission 4 Functions slides are needed for the rest of the lesson. You can show the slides on a big screen, or have students follow the slides on their computers.
If students have time, some extension ideas are given to keep students engaged and applying their knowledge. All are optional, but a great opportunity for student learning.
✅ The assignment is complete and ready to turn in. Both students should include their names on the document. Students should turn in their completed program.
Formative assessment:
- Daily reflection journal
- Mission 4 Kahoot Review
- Exit ticket on procedural abstraction
- Group or class discussion on what they learned in the lesson