1.1.5.A SoundDecisions

Activity 1.1.5 Sound Decisions
Introduction
Computers make decisions based on
questions that have an answer of either true
or false. True or false questions are also
called conditional expressions or Boolean
expressions. The answer to a Boolean
question has only two possible answers but
these answers can be represented in different
ways such as 1 or 0, True or False, and yes or
no.
How can computers be so sophisticated if
they only use questions that can be answered
yes or no? If you've ever played "20
questions," you know that you can get a very
sophisticated result with a few yes/no
questions.
Figure 1. A flow chart with
conditional blocks
Materials
•
•
•
•
Computer with browser
Android device with AI Companion
Google ID
1.1.5 sourceFiles.zip
Procedure
1. Form pairs as directed by your teacher. Greet each other to practice professional
skills.
2. Open App Inventor and create a new project.
3. Place a canvas component in the interface. Place a ball component on the canvas.
Create the event handlers shown in the following image and test the app.
Describe the behavior of the app.
© 2015 Project Lead The Way, Inc.
Introduction to Computer Science Activity 1.1.5 Sound Decisions– Page 1
4. Create the event handler shown here. Right-click the event handler block and
read the help documentation. Modify the event handler so that the app makes a
sound whenever the ball bounces off the "north" wall. Document your work.
5. In the next step, you will expand your program so that each wall produces its own
sound when the ball bounces off of it. This will require four sound files. This
could be completed with one sound component that temporarily changes the
value of its source property to the name of each file as needed. The program could
also be completed with four sound components, each with a permanent source
file. Before you begin, consider which approach is better and explain your
decision.
6. Complete the four-sound program described in the previous step.
7. A client wants a two-player air hockey game for an Android tablet. Create a sprint
task list for the first sprint and complete it. Document your work.
Conclusion Questions
1. Give examples of three programs you have worked with. For each program,
describe an if statement that must be part of the program based on behavior you
have observed.
2. Evi and David are having the following disagreement. Explain which person you
think is correct and why you think so.
Evi: When a computer runs a program, it executes one instruction at a
time, one instruction after another.
David: When a computer runs a program, it makes decisions. So the
computer jumps around the program and doesn't execute the instructions
one after another.
© 2015 Project Lead The Way, Inc.
Introduction to Computer Science Activity 1.1.5 Sound Decisions– Page 2