CS 139 Algorithm Development
Lab01B: Programming with Objects

Background

In today's lab you will explore the concepts of objects, instructions, and sequence. We will focus on examples from the arts including music, design, drawing, and dance.

Objectives

The students will:

Key Terms

Object : programming construct that combines code with data (e.g., a sprite or stage)

Materials Needed

Instructions

Write the answers to the numbered questions in a separate file. You may be asked to share your answers with the rest of the class. Submit your Scratch project and your answer file electronically via Canvas at the end of the lab period.

References

This lab is adapted from the Scratch Curriculum Guide v20110923, released under the Creative Commons Attribution-ShareAlike license.

 


Part 1: Giving Instructions

Step 1. List five situations during the past week when you used instructions written by someone else.

 

 

Step 2. What are instructions good for, in general? Why do we write instructions? What purposes do they serve?

 

 

Step 3. Group activity. We need four people who don't mind being bossy, and four people who don't mind being bossed. Please raise your hand if you would like to participate. After we complete this activity, answer the following questions:

 


Part 2: Dance Party

Tip: Don't forget about the Scratch resource library at http://info.scratch.mit.edu/Support and example projects at http://scratch.mit.edu/channel/featured.

Step 4. Today we are going to make a dance party, which is a Scratch project "where sprites get down with cool costumes and funky beats." Start by adding a sprite with multiple costumes that responds by dancing when clicked.

Step 5. An important programming technique is "incremental development" or adding and testing small amounts of code at a time. At the end of this step, your sprite should have a complex sequence of instructions. Refer to the "Dance Party" handout for ideas.

Step 6. Repeat step 4 until you have several different sprites, each with their own unique dance moves.

We will pause the lab at 30 minutes and 60 minutes for a gallery walk of the projects-in-progress. We encourage you to look at each others' code and ask questions about unfamiliar constructs.

 

Step 7. Think back to your reading of the textbook (Chapter 1.6 and 1.7).