Activity 1.1.5 Sound Decisions

  • Docx File 205.39KByte



Activity 1.1.5 Sound DecisionsIntroductionComputers 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 blocksMaterials Computer with browserAndroid device with AI CompanionGoogle ID1.1.5 sourceFiles.zipProcedure Open App Inventor and create a new project. Use ‘Save project as…’ and rename with your name and the project title and a 1. Rename the screen with the same name, just without the ‘1’ for version 1 at the end.For example:Save a snip here of your file name and screen name change (be sure to includeyour project name from the upper left corner in the snip):Place a canvas component in the interface. Make the canvas take up the entire viewer screen by changing the height and width. 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.Use “Save project as….” and save as the same project name with a 2 at the end (This is your version 2; from now on I will just ask you to save as the next version number and you should know this is the same project name, just with the next number in the sequence.). 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.a) Describe the behavior of the app.b) Save a snip here of your programming blocks: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.Use “Save Project as…” and save as version 3. Complete the four-sound program described in the previous step. You need to use logic and conditional statements. Something like this could be useful. However, there are lots of ways to accomplish this.Save a snip here of your programming blocks (be sure to include your project name from the upper left corner in the snip):Use “Save Project as…” and save as version 4. 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 QuestionsGive 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.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. ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download