Lab #4 Write Up

Name: Adam Coate

Period: 7

Assignment: Lab #4

Lab Overview

Problem #1: For this problem I had to make a sprite change costumes at a certan pace, this pace would change when the user clicked on either the faster or slower sprites. To do this I made a variable named 'speed'. I then set the time between costume switches to 'speed' seconds. The faster and slower sprite would increase or reduce the time between switches.

Problem #3: For ths problem I had to make away to calculate the distance between two points. To do this I made 8 variables named 1-7 and DISTANCE!!. The computer will ask the user what the four points are, then it will calculate the distance by using blocks from the operators section.

Problem #4: For this problem I had to create a dance party. When ever the Pump-it-up sprite is clicked the music will get louder. Once the music gets to a certan point the cops will arive. To acomplish this I made the background set the POLICE variable to 10, I also had it so that it would automaticly set volume to POLICE%. Once the POLICE variable gets above 100 everyone runs and the police arrive to shut it all down.

Problem #1

Problem #3

Problem #4

Questions

Question #1: Variable in computer programming are the same as in math class because a variable is an undefined value that is defined by the user or mathematician.

Question #2: The different ways you can change a variable is by changing its amount and by seting it to a different amount. you can imput the variable to change things such as volume and speed.

Question #3: A variable can have infinite values.

Question #4: The code makes it so that value 1 = value 2 because when value 2 tries to change to value 1 it will stay the same because value 1 is already value 2.

Question #5: The following code makes temp change to value 1, value 1 change into value 2, and value 2 change into temp. But, since temp was set to value 1 before value 2 was set to temp, value 2 will be the same as temp.