6.8 Shape Maker Day 2

OBJECTIVES:

OBJECTIVES: By the end of this lesson, students will:

    • observe that a procedure with an input parameter allow more outcomes.

    • realize that values in a procedure call (arguments), are passed into a block's input parameters.

    • understand how to access data from a list

    • observe that repeat until statement loops until condition is TRUE.

TEACHER RESOURCES:

Standards

    • CSTA 2-AP-13: Decompose problems and subproblems into parts to facilitate the design, implementation, and review of programs.

    • CSTA 2-AP-14: Create procedures with parameters to organize code and make it easier to reuse.

CSTA

DO NOW:

    1. Watch AI Experiments: Quick Draw (1:40)

    2. Discuss:

      • What things does a computer look at when it is trying to understand someone’s drawing?

      • What other areas of life will image and drawing recognition in computer science help with?

Mini-Lesson (5-10 minutes)

Unit 6.7 covers Procedures with Parameters.
Students should make sure that Unit 6.
7 is done, and that they understand the concepts before exploring today's activities 6.8, which covers lists and input checking.

Concept Recap of 6.7:

Important concepts are

  • Values in Procedure call (Arguments) are passed into the block's input parameters.

  • How to access an item from a list. (refresher)

  • Repeat Until will loop until the condition is true. (refresher)

Project (20-30 minutes)

Name the shapes that ShapeMaker draws. To do this, students will

1. create a list of shape names;

2. double check user input, using repeat until, so that the user does not enter a value larger than the list length.


Demonstrate or show video of lesson ( scratch2). Students use student site and student handout to complete project.

1. Create a list:

2. Say shape name:

3. Check user input:

TEACHER GUIDANCE:


Close-Out (5 minutes)

Close-Out (5 minutes)

    1. Discuss the following questions:

      • What is the advantage of creating a procedure block with an input parameter? eg MakeShape(number of sides)

      • What other possible parameters could MakeShape have? lengthOfSide, shape, color, fill (boolean toogle with 0 = no fill, 1 fill), ....etc.

Potential Responses

Some students might ask about the difference between make-a block and broadcast.

Broadcast can communicate to many sprites. Make-a-block can only be seen inside the sprite where is was created.

Broadcast sends out a message signal, with no input parameters. Make-a-Block can have input parameters which makes it flexible and customizable.

Therefore: use broadcast to call lots of sprites: e.g. End of Game

use make-a-block, for reusable code. Add input parameters and you can customize it for many outcomes!

Recap Make-a-Block Slides