Elementary School course

Programming 102

  • GRADES 3-4
  • INTERMEDIATE
  • WEB IPAD
  • 16 LESSONS
Slide: 1 of 21

Answer Key

Module 4: Star Circle

Module 5: Star Circles

Module 6: Collect the Stars

Module 7: Star Patterns

Module 8: Quiz

1. Which of these two turn blocks are equivalent? (Choose 2.)

  • {"func":"blockMotionTurnCW","values":[{"type":"string","value":"180"}]}
  • {"func":"blockMotionTurnCCW","values":[{"type":"string","value":"180"}]}
  • {"func":"blockMotionTurnCW","values":[{"type":"string","value":"90"}]}
  • {"func":"blockMotionTurnCCW","values":[{"type":"string","value":"90"}]}

2. What is the difference between the {"func":"blockMotionTurnCW","values":[{"type":"string","value":"90"}]} and {"func":"blockMotionPointDirection","values":[{"type":"string","value":"90"}]} blocks?

  • The {"func":"blockMotionTurnCW","values":[{"type":"string","value":"90"}]} block changes the actor relative to its current direction, while the {"func":"blockMotionPointDirection","values":[{"type":"string","value":"90"}]} block is not dependent on the current direction of the actor
  • The {"func":"blockMotionTurnCW","values":[{"type":"string","value":"90"}]} block is not dependent on the current direction of the actor, while the {"func":"blockMotionPointDirection","values":[{"type":"string","value":"90"}]} block changes the actor relative to its current direction
  • Both the {"func":"blockMotionTurnCW","values":[{"type":"string","value":"90"}]} and {"func":"blockMotionPointDirection","values":[{"type":"string","value":"90"}]} blocks change the actor relative to its current direction
  • Both the {"func":"blockMotionTurnCW","values":[{"type":"string","value":"90"}]} and {"func":"blockMotionPointDirection","values":[{"type":"string","value":"90"}]} blocks are not dependent on the current direction of the actor

3. What does this code block do? {"func":"registerFlagTrigger","next":{"func":"blockMotionGoTo","values":[{"type":"number","value":"0"},{"type":"number","value":"0"}],"next":{"func":"blockMotionPointDirection","values":[{"type":"wrapper","func":"valueOpRandom","values":[{"type":"number","value":"1"},{"type":"number","value":"360"}]}],"next":{"func":"blockControlForever","containers":[{"func":"blockMotionMove","values":[{"type":"number","value":"10"}],"next":{"func":"blockControlWait","values":[{"type":"number","value":".5"}]}}]}}}}

  • The Actor will start off in the center of the screen and move forever in a random direction
  • The Actor will start off in the center of the screen and move to the right forever
  • The Actor will start in a random location and move forever in a random direction
  • The Actor will start off in the center of the screen and not move

4. Jake wants to program a fireball to fly around the screen randomly. When it hits the wall, it should bounce off. If it hits the ghost, it should just pass through. Which of these code blocks could he use to program this behavior?

  • {"func":"registerFlagTrigger","next":{"func":"blockControlForever","containers":[{"func":"blockMotionPointDirection","values":[{"type":"wrapper","func":"valueOpRandom","values":[{"type":"number","value":"1"},{"type":"number","value":"360"}]}],"next":{"func":"blockMotionMove","values":[{"type":"number","value":"10"}],"next":{"func":"blockControlWait","values":[{"type":"number","value":".5"}],"next":{"func":"blockControlIf","values":[{"type":"wrapper","func":"valueSensingTouchingSprite","values":[{"type":"string","value":"wall"}]}],"containers":[{"func":"blockMotionTurnCCW","values":[{"type":"string","value":"180"}]}]}}}}]}}
  • {"func":"registerFlagTrigger","next":{"func":"blockControlForeverIf","values":[{"type":"wrapper","func":"valueSensingTouchingSprite","values":[{"type":"string","value":"wall"}]}],"containers":[{"func":"blockMotionPointDirection","values":[{"type":"wrapper","func":"valueOpRandom","values":[{"type":"number","value":"1"},{"type":"number","value":"360"}]}],"next":{"func":"blockMotionMove","values":[{"type":"number","value":"10"}],"next":{"func":"blockControlWait","values":[{"type":"number","value":".5"}],"next":{"func":"blockMotionTurnCCW","values":[{"type":"string","value":"180"}]}}}}]}}
  • {"func":"registerFlagTrigger","next":{"func":"blockControlForever","containers":[{"func":"blockMotionPointDirection","values":[{"type":"wrapper","func":"valueOpRandom","values":[{"type":"number","value":"1"},{"type":"number","value":"360"}]}],"next":{"func":"blockMotionMove","values":[{"type":"number","value":"10"}],"next":{"func":"blockControlWait","values":[{"type":"number","value":".5"}],"next":{"func":"blockControlIf","values":[{"type":"wrapper","func":"valueSensingTouchingSprite","values":[{"type":"string","value":"wall"}]}],"containers":[{"func":"blockMotionTurnCCW","values":[{"type":"string","value":"0"}]}]}}}}]}}
  • {"func":"registerFlagTrigger","next":{"func":"blockControlForever","containers":[{"func":"blockMotionPointDirection","values":[{"type":"string","value":"90"}],"next":{"func":"blockMotionMove","values":[{"type":"number","value":"10"}],"next":{"func":"blockControlWait","values":[{"type":"number","value":".5"}],"next":{"func":"blockControlIf","values":[{"type":"wrapper","func":"valueSensingTouchingSprite","values":[{"type":"string","value":"wall"}]}],"containers":[{"func":"blockMotionTurnCCW","values":[{"type":"string","value":"180"}]}]}}}}]}}

5. Which of these two turn blocks are equivalent? Remember that it takes 360 degrees to turn an entire circle. (Choose 2.)

  • {"func":"blockMotionTurnCW","values":[{"type":"string","value":"60"}]}
  • {"func":"blockMotionTurnCCW","values":[{"type":"string","value":"300"}]}
  • {"func":"blockMotionTurnCW","values":[{"type":"string","value":"180"}]}
  • {"func":"blockMotionTurnCCW","values":[{"type":"string","value":"0"}]}

6. True or False: Colors can be represented by hexadecimal numbers like #ffffff as in the block
{"func":"blockPenSetColor","values":[{"type":"color","value":"#ffffff"}]}

  • True
  • False

7. Which block is used to set the pen color?

  • {"func":"blockPenSetColor","values":[{"type":"color","value":"#ffffff"}]}
  • {"func":"blockPenUp"}
  • {"func":"blockPenDown"}
  • {"type":"wrapper","func":"valueSensingMouseDown"}

8. Which block is used to change the pen color by a specific value?

  • {"func":"blockPenChangeHue","values":[{"type":"number","value":"10"}]}
  • {"func":"blockPenUp"}
  • {"func":"blockPenDown"}
  • {"func":"blockPenClear"}

9. Amy wants to program her zombie to follow the hero. Which of these blocks will make the zombie point towards the hero?

  • {"func":"blockMotionPointTowards","values":[{"type":"string","value":"hero"}]}
  • {"func":"blockMotionTurnCW","values":[{"type":"wrapper","func":"valueSensingSpriteProperty","values":[{"type":"choice","value":"direction"},{"type":"string","value":"hero"}]}]}
  • {"func":"blockMotionGoTowards","values":[{"type":"wrapper","func":"valueSensingSpriteProperty","values":[{"type":"choice","value":"direction"},{"type":"string","value":"hero"}]}]}
  • {"func":"blockMotionBounceOnEdge"}

10. Which block of code would you use to program the second hand of a clock?

  • {"func":"blockControlForever","containers":[{"func":"blockMotionTurnCW","values":[{"type":"string","value":"5"}],"next":{"func":"blockControlWait","values":[{"type":"number","value":"1"}]}}]}
  • {"func":"blockControlForever","containers":[{"func":"blockMotionTurnCW","values":[{"type":"string","value":"6"}],"next":{"func":"blockControlWait","values":[{"type":"number","value":"1"}]}}]}
  • {"func":"blockControlForever","containers":[{"func":"blockMotionTurnCW","values":[{"type":"string","value":"10"}],"next":{"func":"blockControlWait","values":[{"type":"number","value":"1"}]}}]}
  • {"func":"blockControlForever","containers":[{"func":"blockMotionTurnCW","values":[{"type":"string","value":"15"}],"next":{"func":"blockControlWait","values":[{"type":"number","value":"1"}]}}]}

11. A ball that is on the center of the Stage has the following code associated with it. What happens when you click the ball? {"func":"registerSpriteTrigger","next":{"func":"blockMotionPointDirection","values":[{"type":"string","value":"45"}],"next":{"func":"blockMotionMove","values":[{"type":"number","value":"100"}],"next":{"func":"blockMotionTurnCW","values":[{"type":"string","value":"180"}],"next":{"func":"blockMotionMove","values":[{"type":"number","value":"100"}]}}}}}

  • The ball moves 100 pixels towards the top right corner, then turns in a different direction and moves 100 pixels.
  • The ball moves 100 pixels towards the bottom right corner, then turns in a different direction and moves 100 pixels.
  • The ball moves 100 pixels towards the top left corner, then turns in a different direction and moves 100 pixels.
  • Nothing happens

12. An Actor has this code associated with it. What does this code draw? {"func":"registerFlagTrigger","next":{"func":"blockPenUp","next":{"func":"blockControlRepeat","values":[{"type":"number","value":"4"}],"containers":[{"func":"blockMotionMove","values":[{"type":"number","value":"100"}],"next":{"func":"blockMotionTurnCW","values":[{"type":"string","value":90}]}}]}}}

  • A triangle
  • A rectangle
  • A square
  • It does not draw anything

13. Julie wanted to draw a dashed line with two colors and used this code for an Actor. What happens when she runs the program? {"func":"registerFlagTrigger","next":{"func":"blockMotionGoTo","values":[{"type":"number","value":"0"},{"type":"number","value":"0"}],"next":{"func":"blockPenDown","next":{"func":"blockPenSetColor","values":[{"type":"color","value":"#00ff00"}],"next":{"func":"blockControlRepeat","values":[{"type":"number","value":"20"}],"containers":[{"func":"blockPenChangeHue","values":[{"type":"number","value":"100"}],"next":{"func":"blockMotionMove","values":[{"type":"number","value":"10"}],"next":{"func":"blockPenChangeHue","values":[{"type":"number","value":"-100"}]}}}]}}}}}

  • A dashed line with alternating colors of length 200 is drawn.
  • A never ending green line is drawn.
  • The Actor moves but nothing is drawn.
  • A green line of length 200 pixels is drawn.

14. I want to draw a colorful line where the color keeps changing. Which of these blocks can I use? (Select All)

  • {"func":"blockPenSetColor","values":[{"type":"color","value":"#ff00ff"}]}
  • {"func":"blockPenChangeHue","values":[{"type":"number","value":"10"}]}
  • {"func":"blockPenSetHue","values":[{"type":"wrapper","func":"valueOpRandom","values":[{"type":"number","value":"1000"},{"type":"number","value":"10000"}]}]}
  • {"func":"blockLooksChangeEffect","values":[{"type":"choice","value":"color"},{"type":"number","value":"10"}]}

15. Caleb is programming 2 propellers that turn at different speeds. How should he code?

Script AScript B
{"func":"blockControlForever","containers":[{"func":"blockMotionTurnCW","values":[{"type":"string","value":"1"}],"next":{"func":"blockControlWait","values":[{"type":"number","value":".01"}]}}]}    {"func":"blockControlForever","containers":[{"func":"blockMotionTurnCW","values":[{"type":"string","value":"10"}],"next":{"func":"blockControlWait","values":[{"type":"number","value":".01"}]}}]}

  • Use Script A for the slow propeller and Script B for the fast propeller.
  • Use Script A for the fast propeller and Script B for the slow propeller.
  • Use script A for both propellers.
  • Use script B for both propellers.

16. A ball that is on the center of the Stage has the following code associated with it. What happens when you tap the ball? {"func":"registerSpriteTrigger","next":{"func":"blockMotionPointDirection","values":[{"type":"string","value":"45"}],"next":{"func":"blockMotionMove","values":[{"type":"number","value":"100"}],"next":{"func":"blockMotionTurnCW","values":[{"type":"string","value":"180"}],"next":{"func":"blockMotionMove","values":[{"type":"number","value":"100"}]}}}}}

  • The ball moves 100 pixels towards the top right corner, then turns in a different direction and moves 100 pixels.
  • The ball moves 100 pixels towards the bottom right corner, then turns in a different direction and moves 100 pixels.
  • The ball moves 100 pixels towards the top left corner, then turns in a different direction and moves 100 pixels.
  • Nothing happens

U.S. Standards

  • CCSS-Math: 3.NBT.A.2, MP.1
  • CCSS-ELA: RF.3.4.A, RF.4.4.A
  • CSTA: 1B-AP-11, 1B-AP-12, 1B-AP-15
  • CS CA: 3-5.AP.13, 3-5.AP.14, 3-5.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

Lesson 9: Drawing Patterns

Course: | iPad Web

  • Introduction
  • Concepts
  • Star Patterns Example
  • Star Circle
  • Star Circles
  • Collect the Stars
  • Star Patterns
  • Quiz

Description

Advance your class to intermediate level programming concepts using a wider set of visual blocks. In Snowball Siege, students learn about layering, Actor visibiliy, motion, and collisions. Then, in Star Runner, they use line drawing commands and program math art. They build several mini-games while understanding how to create more complex programs. After completing this lesson plan, students will be able to build a wide variety of school projects and their own comprehensive games.

Topics

  • Animation sequences
  • Motion
  • Game design basics
  • Built-in animation commands
  • Advanced keyboard and mouse control
  • Sending and receiving messages
  • Actor layering
  • Advanced events
  • Math operators
  • Functions

What Students Learn

  • Gain confidence in building a variety of programs
  • Apply programming concepts to build your own games
  • Design characters with multiple animation sequences
  • Write interactive stories with multiple scenes
  • Make an image editor using drawing primitives
  • Define more advanced keyboard and mouse interaction
  • Program special effects and explosions
  • Troubleshoot and debug 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