Scratch Lab 7

Pair Programming

Problem #1

Problem #2

Questions

  1. What are two advantages to using blocks for code repetition?
  2. You don't need to retype the whole code each time. It makes the code easier to debug.

  3. What are parameters?
  4. A parameter is like a variable but it has a procedure attached.

  5. Give an example of a formula that takes at least one parameter.
  6. The distance formula takes four parameters, x1, x2, y1, and y2.

  7. Give an example of a situation where no parameters are needed
  8. Something like telling a sprite to move 4 steps and turn 30 degrees.

  9. Explain what you think the following program does? How do blocks make this easier to understand? Explain what you would expect within each block.
  10. It puts strings into alphabetical order. Blocks breifly describe what steps are happening to accomplish alphabetical order. Get name would probably ask for an answer. Insert into list would put it in a list. Reorder list would order the list based on alphabetical order with the new value included. Continue would keep the code running until "task_complete=true".