Home About Me Scratch Web Development Google 20 Python Assignments Java Assignments

My Scratch Stuff

Assignments

Partner Project

In this project, my partner, Randy, and I were tasked with making a spaceship fly up and down at different speeds. This was relatively simple, we just had to make the values greater than 1 multiply by 2, so as the arrow to go faster was pressed, the spaceship would go up faster. And when the down arrow was pressed the ship would change it's Y-Coordinate also by multiplying it by 2, but because it was negative it would change downwards.

Click here for the project link.

Quick Costume Change

This project I was to make a character change his costume faster and slower. This was done very similarly to the spaceship project. As I pressed the faster button, the sprite would change his costume faster because the time at which it would wait between costume changes would be 1 / "Speed". Speed being a variable that would increase by 1 when the up arrow is pressed. The down arrow would do almost the same thing except it would multiply the negative value by -1.5. So it would be "Speed" x -1.5. So it would wait longer everytime it clicked.

Click here for the project link.

A.I.

This project was very simple. I had to take multiple answers from the user, and then after asking all the questions I would have a second sprite appear, and have the original sprite talk to the other sprite about the user.

Click here for the project link.

Distance Formula

This project was based on finding the distance between two points. The distance forumla (Square root of (x2-x1)^2 + (y2-y1)^2) was put into a joint and when values for points were given it would plug those values into there appropriate spots and then solve for the distance.

Click here for the project link.

Metric Converter

In this project I was supposed to make a converter that turned Imperial Units into Metric Units. This was done by taking Feet and Inches, and turning it into kilometers, meters, and millimeters. It was not that easy. Everytime there was one thousand millimeters, I had to subtract 1000 mm and add 1 meter. Also, everytime there was 1000 meters, I had to subtract that from meters and add one to kilometers. This would give the final measurement converted.

Click here for the project link.

Questions

  1. Are variables in computer programming the same as variables in math class? Why or why not?
  2. When creating a variable, what are the two types of scope a variable can have? That is, what can it affect.
  3. How many values can a variable store at one time?
  4. What will the following code snippet do? Explain why it doesn’t work as intended.
  5. Given the following code snippet, explain what is happening.