Middle School course

Programming 201

  • GRADES 5-6
  • BEGINNER
  • WEB IPAD
  • 17 LESSONS
Slide: 1 of 19

Answer Key

Module 3: Send a Message to the BeatBot

Module 4: Send 2 Messages

Module 6: Add Your Background Music

Module 7: Quiz

1. Which block can be used to send a message from the button to the Beatbot?

  • {"func":"blockControlBroadcast","values":[{"type":"string","value":""}]}
  • {"func":"blockSoundPlayDrum","values":[{"type":"choice","value":"35 Acoustic Bass Drum"},{"type":"number","value":"0.2"}]}
  • {"func":"blockSoundPlay","values":[{"type":"string","value":""}]}
  • {"func":"blockSoundPlayUntilDone","values":[{"type":"string","value":""}]}

2. You have an Actor that will play a punch sound when they receive the message 'punch'. What will happen if we remove the 'Broadcast' block from the following code?
{"func":"registerKeyTrigger","values":[{"type":"choice","value":"left arrow"}],"next":{"func":"blockLooksNextCostume","next":{"func":"blockControlWait","values":[{"type":"number","value":".3"}],"next":{"func":"blockLooksSwitchCostume","values":[{"type":"string","value":"blue button off"}],"next":{"func":"blockControlBroadcast","values":[{"type":"string","value":"punch"}]}}}}}

  • The message will be broadcast and the punch sound will play
  • The message will not be broadcast and the punch sound will play
  • The message will be broadcast and the punch sound will not play
  • The message will not be broadcast and the punch sound will not play

3. What does the following code do?
{"func":"registerKeyTrigger","values":[{"type":"choice","value":"right arrow"}],"next":{"func":"blockLooksNextCostume","next":{"func":"blockControlWait","values":[{"type":"number","value":".3"}],"next":{"func":"blockLooksSwitchCostume","values":[{"type":"string","value":"blue button off"}],"next":{"func":"blockControlForever","containers":[{"func":"blockControlBroadcast","values":[{"type":"string","value":"punch"}]}]}}}}}

  • When the right arrow is pressed, the button will change costumes and the 'punch' message will be sent once
  • When the right arrow is pressed, the button will change costumes and the 'punch' message will be sent repeatedly until the end of the program
  • When the right arrow is pressed, the button will change costumes but the 'punch' message will not be sent
  • When the right arrow is pressed, the button will change costumes and the 'punch' message will be sent ten times

4. True or False: In the following code, the punch sound will still play if we change what message we are broadcasting.
{"func":"registerKeyTrigger","values":[{"type":"choice","value":"left arrow"}],"next":{"func":"blockLooksNextCostume","next":{"func":"blockControlWait","values":[{"type":"number","value":".3"}],"next":{"func":"blockLooksSwitchCostume","values":[{"type":"string","value":"blue button off"}],"next":{"func":"blockControlBroadcast","values":[{"type":"string","value":"punch"}]}}}}}

  • True
  • False

5. True or False: In the following code, the punch sound will still play if we remove the {"func":"blockLooksNextCostume"} block.
{"func":"registerKeyTrigger","values":[{"type":"choice","value":"left arrow"}],"next":{"func":"blockLooksNextCostume","next":{"func":"blockControlWait","values":[{"type":"number","value":".3"}],"next":{"func":"blockLooksSwitchCostume","values":[{"type":"string","value":"blue button off"}],"next":{"func":"blockControlBroadcast","values":[{"type":"string","value":"punch"}]}}}}}

  • True
  • False

6. Elizabeth wants the first song in the following code to finish playing before the second song starts, but the code is skipping the first song and playing the second song. What can she do to play the songs correctly?
{"func":"blockSoundPlay","values":[{"type":"string","value":"Song1"}],"next":{"func":"blockSoundPlay","values":[{"type":"string","value":"Song2"}]}}

  • The songs cannot be played correctly
  • Replace the first {"func":"blockSoundPlay","values":[{"type":"string","value":""}]} with {"func":"blockSoundPlayUntilDone","values":[{"type":"string","value":""}]}
  • Replace the second {"func":"blockSoundPlay","values":[{"type":"string","value":""}]} with {"func":"blockSoundPlayUntilDone","values":[{"type":"string","value":""}]}
  • Add a {"func":"blockControlForever","containers":[null]} block around the code block

7. True or False: An Actor can only have one {"func":"blockControlBroadcast","values":[{"type":"string","value":""}]} block.

  • True
  • False

8. What block is needed to receive the message from a broadcast block?

  • {"func":"registerBroadcastTrigger","values":[{"type":"string","value":""}]}
  • {"func":"blockControlBroadcast","values":[{"type":"string","value":""}]}
  • {"func":"blockSoundPlayUntilDone","values":[{"type":"string","value":""}]}
  • {"func":"registerFlagTrigger"}

9. What code block will play an entire song five times in a row?

  • {"func":"blockControlRepeat","values":[{"type":"number","value":"5"}],"containers":[{"func":"blockSoundPlayUntilDone","values":[{"type":"string","value":"Song"}]}]}
  • {"func":"blockControlRepeat","values":[{"type":"number","value":"5"}],"containers":[{"func":"blockSoundPlay","values":[{"type":"string","value":"Song"}]}]}
  • {"func":"blockControlForever","containers":[{"func":"blockSoundPlay","values":[{"type":"string","value":"Song"}]}]}
  • {"func":"blockSoundPlayUntilDone","values":[{"type":"string","value":"Song"}]}

10. True or False: It is possible to add your own sounds to an Actor.

  • True
  • False

11. What does the following code do?
{"func":"registerFlagTrigger","next":{"func":"blockControlForever","containers":[{"func":"blockSoundPlayDrum","values":[{"type":"choice","value":"35 Acoustic Bass Drum"},{"type":"number","value":"0.2"}]}]}}

  • It plays the drum sound forever when the play button is clicked
  • It plays the drum sound once when the play button is clicked
  • It plays the drum sound forever when the left button is pressed
  • It plays the drum sound forever when the Actor is clicked

12. What is the purpose of the parameter in the {"func":"blockControlBroadcast","values":[{"type":"string","value":""}]} block?

  • It specifies which message is being broadcast
  • It specifies which sound will be played
  • It specifies the name of the Actor
  • It specifies which drum sound will be played

13. What does the following code do?
{"func":"registerTrigger","values":[{"type":"wrapper","func":"valueSensingMouseDown"}],"next":{"func":"blockSoundPlay","values":[{"type":"string","value":"Song"}]}}

  • It plays the song when the mouse is pressed
  • It plays the song when the play button is clicked
  • It plays the song when the Actor is clicked
  • It plays the song when the spacebar is pressed

14. What will happen if you move the {"func":"blockControlBroadcast","values":[{"type":"string","value":"punch"}]} block to the bottom of the following code?
{"func":"registerKeyTrigger","values":[{"type":"choice","value":"left arrow"}],"next":{"func":"blockControlBroadcast","values":[{"type":"string","value":"punch"}],"next":{"func":"blockLooksNextCostume","next":{"func":"blockControlWait","values":[{"type":"number","value":".1"}],"next":{"func":"blockLooksSwitchCostume","values":[{"type":"string","value":"blue button off"}]}}}}}

  • The BeatBot will play its sound before the button changes costumes
  • The BeatBot will play its sound after the button changes costumes
  • The BeatBot will not play any sounds
  • The BeatBot will play its sound while the button changes costumes

15. Which of the following sets of code blocks can be used to create an animation for an Actor?

  • {"func":"registerFlagTrigger"}, {"func":"blockControlForever","containers":[null]}, {"func":"blockLooksNextCostume"}, {"func":"blockControlWait","values":[{"type":"number","value":""}]}
  • {"func":"blockControlBroadcast","values":[{"type":"string","value":""}]}, {"func":"blockControlWait","values":[{"type":"number","value":"1"}]}
  • {"func":"registerSpriteTrigger"}, {"func":"blockSoundPlay","values":[{"type":"string","value":""}]}
  • {"func":"blockMotionMove","values":[{"type":"number","value":"10"}]}, {"func":"blockLooksNextCostume"}

16. If you wanted to play the sound from the blue button instead of the BeatBot, which of the following blocks will be unnecessary?
{"func":"registerKeyTrigger","values":[{"type":"choice","value":"left arrow"}],"next":{"func":"blockControlBroadcast","values":[{"type":"string","value":"punch"}],"next":{"func":"blockLooksNextCostume","next":{"func":"blockControlWait","values":[{"type":"number","value":".1"}],"next":{"func":"blockLooksSwitchCostume","values":[{"type":"string","value":"blue button off"}]}}}}}

  • {"func":"blockControlBroadcast","values":[{"type":"string","value":"punch"}]}
  • {"func":"blockLooksNextCostume"}
  • {"func":"blockControlWait","values":[{"type":"number","value":".1"}]}
  • {"func":"blockLooksSwitchCostume","values":[{"type":"string","value":"blue button off"}]}

17. What will happen if you make both the blue and orange buttons broadcast the "punch" message?

  • Both the buttons will make the same sound when pressed
  • The "punch" message will no longer work
  • The buttons will still play their original sounds when pressed
  • Neither of the buttons will be able to play sounds anymore

U.S. Standards

  • CCSS-Math: MP.1
  • CCSS-ELA: RF.5.4.A, 6-8.RST.3, 6-8.RST.4, 6-8.RST.7
  • CSTA: 1B-AP-11, 1B-AP-12, 1B-AP-15, 2-AP-13, 2-AP-16, 2-AP-17
  • CS CA: 3-5.AP.10, 3-5.AP.13, 3-5.AP.14, 3-5.AP.17, 6-8.AP.13, 6-8.AP.16, 6-8.AP.17
  • ISTE: 1.c, 1.d, 4.d, 5.c, 5.d, 7.c

U.K. Standards

Key stage 2
Pupils should be taught to:
  • design, write and debug programs that accomplish specific goals, including controlling or simulating physical systems; solve problems by decomposing them into smaller parts
  • use sequence, selection, and repetition in programs; work with variables and various forms of input and output
  • use logical reasoning to explain how some simple algorithms work and to detect and correct errors in algorithms and programs
  • understand computer networks, including the internet; how they can provide multiple services, such as the World Wide Web, and the opportunities they offer for communication and collaboration
  • use search technologies effectively, appreciate how results are selected and ranked, and be discerning in evaluating digital content
  • select, use and combine a variety of software (including internet services) on a range of digital devices to design and create a range of programs, systems and content that accomplish given goals, including collecting, analysing, evaluating and presenting data and information
  • use technology safely, respectfully and responsibly; recognise acceptable/unacceptable behaviour; identify a range of ways to report concerns about content and contact
Key stage 3
Pupils should be taught to:
  • design, use and evaluate computational abstractions that model the state and behaviour of real-world problems and physical systems
  • understand several key algorithms that reflect computational thinking [for example, ones for sorting and searching]; use logical reasoning to compare the utility of alternative algorithms for the same problem
  • undertake creative projects that involve selecting, using, and combining multiple applications, preferably across a range of devices, to achieve challenging goals, including collecting and analysing data and meeting the needs of known users
  • create, reuse, revise and repurpose digital artefacts for a given audience, with attention to trustworthiness, design and usability
  • understand a range of ways to use technology safely, respectfully, responsibly and securely, including protecting their online identity and privacy; recognise inappropriate content, contact and conduct, and know how to report concerns

Lesson 12: Broadcasting Messages

Course: | iPad Web

  • Introduction
  • Send a Message Example
  • Send a Message to the BeatBot
  • Send 2 Messages
  • Add Your Background Music Example
  • Add Your Background Music
  • Quiz

Description

An introduction to programming for beginners in upper elementary grades. Introduce your class to programming using a fun scenario-based approach where they build two complete games. Side Scroller Survival introduces them to basics of motion and animation. In BeatBot Battle, they program a robot to make it dance. On completing this lesson plan students will be able to build simple games, animations, and a variety of simple projects.

Topics

  • Use sequencing
  • Pattern recognition
  • Loops
  • Conditional logic
  • Create scenes
  • Add sounds and music
  • Use keyboard controls
  • Learn about motion
  • Broadcasting messages
  • Adding special effects

What Students Learn

  • Create interactive scenes with actors, scenes and music
  • Design animations using loops
  • Program motion along x- and y-axes
  • Build algorithms using conditional logic
  • Understand scripts running in parallel
  • Program music using notes, tempo and instruments
  • Create different scenarios and effects in games
  • Publish projects to the Web
  • Troubleshoot and debug simple programs

Technical Requirements

* Online courses require a modern desktop computer, laptop computer, Chromebook, or Netbook with Internet access and a Chrome (29+), Firefox (30+), Safari (7+), or Edge (20+) browser. No downloads required.
* Tablet courses require an iPad (iOS 10+) with Tynker or Tynker Junior app installed and Internet access