< Course F (2021)

Lesson 8: Mini-Project: User Input Programs

50 minutes

Overview

Students will apply their new skills with variables to one of three open-ended mini-projects. Students will explore sample programs, create a plan for their own project, and program it from scratch.

Purpose

This lesson doesn’t introduce new skills or concepts, but instead gives students the opportunity to apply what they have been learning in a creative way.

CSTA K-12 Computer Science Standards (2017)
    • 1B-AP-11 - Decompose (break down) problems into smaller, manageable subproblems to facilitate the program development process.
    • 1B-AP-12 - Modify, remix or incorporate portions of an existing program into one's own work, to develop something new or add more advanced features.
    • 1B-AP-15 - Test and debug (identify and fix errors) a program or algorithm to ensure it runs as intended.
    • 1B-AP-17 - Describe choices made during program development using code comments, presentations, and demonstrations.

Agenda

Objectives

Students will be able to:
  • Create an interactive computer program that responds to user input.
  • Use variables in conjunction with prompts.
  • Use variables to hold words and phrases.

Preparation

  • Print the planning guide or distribute a digital copy to each student. Review it ahead of time in case you would like to make any modifications to fit your class.

  • Review the options in level 3 ahead of time to get familiar with the flow students will need to follow.

  • This lesson has the potential to stretch to multiple class periods. Consider scheduling implications ahead of time.

Links

Heads Up! Please make a copy of any documents you plan to share with students.

For the teachers
For the students

Vocabulary

  • Input - The information computers get from users.
  • Prompt - A message on the computer screen that waits for input from the user.
  • Variable - A label for a piece of information used in a program.

Teaching Guide

Warm Up (10 minutes)

Review

Do This: Using the lesson slides, review the concepts that students have explored so far in the course: sprites, behaviors, events, and text. Finally, review how prompts and variables work.

Prediction

Do This: Have students read the provided code and make a prediction about what will happen. After pressing “Run”, provide time for students to reflect on anything they found interesting or that surprised them.

Teaching Tip

One of the trickiest parts of learning variables is making sure that a variable’s label always matches. In this level, be sure that students notice the difference between the variable meal and the variable food. Students should understand that the best way to solve this would be to just use one variable, making sure the label always matches.

You can also walk your class through correcting the bugs in this program by using this Teacher Sandbox level with your projector.

Exploration

Do This: Have students explore the sample programs in level 1. This can be done as a whole class with discussion, with pairs sharing a device, or even individually. For each of the programs, have students think about how it works, who would use it, and any ideas it gives them about what they could make themselves. A good strategy here is to have students read the program’s code out loud, one line at a time, then talk about what it is for.

Teaching Tip

If you are short on time or want to minimize transitions, complete this portion of the lesson as a whole group discussion. You can remind students that they can revisit these programs later if they have a question about how something works.

If you have already gone through the entire lesson yourself, you can also show them your own finished program for inspiration!

Main Activity (30 minutes)

User Input Programs

Remarks

Planning (10 mins)

We have already had a chance to build a variety of programs in Sprite Lab. Today, this experience will be much more open-ended, so it will require planning beforehand! Planning is a very important part of coding a game or any other kind of software.

Teaching Tip

If you are short on time, it’s acceptable to have students just focus on the first page of the planning guide. Students can also re-use the same stories they completed during the "Blank Space Stories" lesson.

Mini-Project (20 mins)

Equipped with their completed planning guides, students are now ready to bring their projects to life. Transition students to their computers and ask them to start “Part 1” of their chosen project.

Teaching Tip

This level presents students with a menu of options that correspond to the main project types they chose from. The main differences between these sublevels are the instructions and default sprite costumes. Students may need really clear instructions to understand how to navigate the choices here. For each of the project choices, there are two sub-levels here. To begin, students should pick one of the levels marked "Part 1". Once they finish that level, they should return here and select "Part 2" of the same project. The first level for each choice will provide students with feedback as they put the basic components of their project together. The second level is "free play," which is intended to allow students to make any changes to their code that they like.

Wrap Up (10 minutes)

Showcase

Do This: To celebrate students' work, spend the last 10 minutes or so allowing them to showcase their projects. This can be done in many ways, but here are a few:

  • Public Demo: Select a few exemplary volunteers to briefly demo their projects in front of the class. As they do so, have them touch on what the planning-to-coding experience was like for them, including ideas they'd still like to implement.
  • Pair Playtesting: Have students or groups pair up and playtest each other's projects. As they do, ask them to provide positive and constructive feedback to each other. The benefit here is that students will have the opportunity to provide and respond to feedback in a smaller setting.
  • Gallery Walk: Ensure all students have their projects ready for testing. Have students move "musical chairs"-style to another computer and play/test the project there for a few minutes, until they receive a signal from you to move to another computer. Repeat this every few minutes. While there is less opportunity for structured communication here, this ensures students get to demo as many of their peers' projects as possible.
Creative Commons License (CC BY-NC-SA 4.0).

This work is available under a Creative Commons License (CC BY-NC-SA 4.0).

If you are interested in licensing Code.org materials for commercial purposes contact us.