Name: Zak "The Legend" Singh
Period: 7
Assignment:Scratch Lab #7
For Problem 1, we had to make a distance calculator using a custom block. The program would ask the coordinates for the first and second point and then tell you the distance between them.
In problem 2, we created a block that only accepted feet. The program would then convert the number to inches if it was smaller than a mile, or miles if it was more than a mile.
For problem 1, I first defined x1, y1, x2, and y2 as variables. Then I added in the distance formula, using the variables mentioned. Then the program asks the positions of each coordinate and sets the corresponding variable to the answer.
For problem 2, I first defined feet as a variable. Then scratch would ask how many feet you want to enter. I then had an if/else conditional. If the answer of the previous question was over 5280, then it would convert the feet to miles and round it to a whole number. Otherwise it would convert feet to inches and round it to a whole number.
Problem 1
Problem 2