An example of an in/out box project with a rule of x+12.


Students work with partners or individually to create a new Scratch activity which uses In and Out boxes that follow a rule such as this rule, x + 12.


Programming Skills with Scratch:

  • Create and name lists
  • Use the ask and wait and answer blocks to input data into lists
  • Use an answer block with Operators blocks to create a rule
  • Use a repeat until block with an answer block and an operators block
  • Scratch blocks used: (ask and wait, answer, say, repeat until, Make a List, add __to list, delete all of list, when this sprite clicked, when space key pressed, Operators)


  1. Review how In/Out Boxes work. Give several examples and let students find the rule for each example.The full screen button is located in the top left corner above the stage.
  2. Open and try the Scratch activity Input/Output link shown above. View this activity in full screen mode by clicking the blue box above the stage. In this view students will not be able to see the rule shown in the script area. Try some negative numbers for the In Box.
  3. When students have guessed the rule, x + 12, click out of full screen view by clicking the same blue box and look at the blocks in the script area.
  4. Do Unplugged Activity Mad Libs
  5. Be sure students know how to create and name a list.
    1. Click the Data category.
    2. Click Make a List.
    3. Give the list a name. Be sure to name the list clearly so the name explains what is in the list. In this activity the first list was named in (x) and the second list was named out (y).
    4. To show or hide a list on the stage, click or unclick the box in front of the list’s name.
  1. Look at the script under the green flag. Ask students what the delete all blocks do. If they are unsure, An example of Scratch code using the delete all block on the in (x) and out (y) lists.remove these from the script and run the activity several times. What is different?

  2. Ask students to explain what happens when the space key is pressed.A scratch code snippet. When space key is pressed ask What is the input number? and wait add answer to in (x) say answer + 12 for 2 seconds add answer + 12 to out (y) What does the add answer to in (x) block do? The blocks can be pulled apart. Click on each to see what each does. Emphasis the rule in this activity is shown in the addition block.

  3. What happens when the sprite is clicked?A scratch code snippet. When this sprite clicked ask Do you know my rule? What is it? and wait repeat until { answer = x + 12 say Maybe that rule works, but that is not the rule I am using. Try again. for 2 seconds } say Yes! for 2 seconds.

  4. Why is the repeat until block usedA scratch code snippet. When this sprite clicked ask Do you know my rule? What is it? and wait repeat { answer = x + 12 say Maybe that rule works, but that is not the rule I am using. Try again. for 2 seconds } say Yes! for 2 seconds. instead of the repeat block? If students are unsure, replace the repeat until block with a repeat block and run the script to see what happens. The new script would look like this.

  5. Show students how the rule can be changed by changing the operators block. Let students create a new rule and suggest the changes to the script needed so the new rule works. For example, if you change the rule to 2x + 3. The new operators block would be this.An operator block the calculates the product of 2 and answer then adds 3.

Information for Teacher:

The operators blocks can be dropped into each other. When solving a formula, the blocks on the top indicate the operations that are completed first. For example, if you want a script to solve this expression, 2(6 + 9), you would use this script. Notice how (6 + 9) is on the top layer. That is the operation that the computer completes first.An operator block that computes the sum of 6 and 9, then multiplies the sum by 2.

  1. Decide if you want students to work with partners or alone.
  2. Pass out copies of the In/Out Box and the Rule. Students should have two other students sign their worksheet. Those students sign if they agree that the first student’s rule and chart are correct. Ask students not to sign someone’s worksheet if they think the rule or the chart is incorrect. Instead, they should help the student correct the worksheet before they sign. When students have completed the worksheet and have had two other students sign the worksheet, allow time for them to open a new scratch activity and create their own In/Out Box activity.
  3. Allow time for students try others’ activities and to guess the rule used in others’ activities.


Let students use Scratch to create their on conversion activity. Some suggestions students could use for their conversion activities are: yards to inches, miles to feet, grams to milligrams, US dollars to British pounds, pints to cups, years to months, hours to seconds, or pounds to ounces. Be sure to allow time for students to share the activities.

Common Core:

5.0A.3, 5.MP.1, 5.G.1, 5.G.2

CT/CS Standards and Skills:

CS-Solve problems by decomposing them into smaller parts, Write programs that accomplish specific goals, Work with various forms of input/output, functions with input/output
CT-Abstraction, Generalizing, Algorithmic Design

Champaign Unit 4 School DistrictKenwood Elementary School: bright stars, bright futures
College of Education at IllinoisUChicago STEM EducationNSF
These lessons were written by Judy Rocke based on lessons developed at Kenwood Elementary School in the Champaign Unit 4 school district. Funding was provided by the National Science Foundation under award number 1542828. These lessons are intended to be used alongside the EM-4 curriculum.

Lessons prepared as web documents in Summer 2017. Contact us for updated lesson plan materials.