ScratchLab4

Scratch Lab #4

Lab Overview

This lab required us to use variables to create effects such as speeding up movements and storing information to be repeated back. My projects are HERE HERE and HERE

My Solution

My solution to the first problem was to create a sprite that switched costumes inside a forever loop while the time between costumed changes was increased or decreased depending on the variable speed. The speed variable was controlled by two sprites, one that said faster and one that said slower. My solution to the second problem was to create a sprite that asks the user questions, then stores the answers as variable to be repeated back to a sprite that appears when the conversation ends. I used different varibles for every answer, then had the sprite say those variables in the next conversation. My solution to the third problem was to create a sprite that asks the user for four coordinates and sets the answers as variables. Those variables are then plugged into the distance formula (made using operator blocks) to create the distance variable that describes the distance between the two points.

Questions

  1. Are variables in computer programming the same as variables in math class? Why or why not? Variables in computer programming are different because you know what they are, unlike in math.

Click HERE to return to homepage