Lab Write Up

Name: Sam Basilico

Period: 7

Assignment: Lab #6

Lab Overview

In this lab, the task was to create a sprite which takes a word as input and then spells the word back to the user one letter at a time. If the word is longer than 10 letters then the sprite should ask for a new word.

My Solution

My solution to make 2 variables. One variable controlled the asnwer to the qeustion the sprite asked which was what the word was. My other variable controlled which letter the sprite said when it repeated the word. To make it repeat the variable and add one to it so it says the letter and increases each time.

My Project Link

Lab Overview

In this problem, I had to write a program in Scratch that will make a sprite move up, down, left, and right. The sprite will draw lines on the screen as it moves.

My Solution

My solution to this problem was to make a ton of 'if' statements. All of them related to how which key was pushed. If a certain key was pushed, it activated that code and made the sprite move with its pen down, drawingv all over the screen. In order to make it so that when the spacebar is pushed, I made another if statement that when the spacebar was pushed, it would clear the pen and make the sprite go to the center.

My project link

Questions

  1. What is the difference between and if and and if-else statement?
    • An if statement is activated, then it activates that code, but if an if statement is activated, it will only do that code or any other code that happens.
  2. Is there a simpler way to write the following code? Explain.
    • Yes you can omit the move ten steps in the first if and just leave the other move ten steps in the esle and it will work the same.
  3. Which students are described by the following conditional? “if you are not a Senior and you are on the soccer team or you are in band then…”
    • students in the band and students who are non seniors in the soccer team
  4. If the statement from Question 3 is changed as shown below, who else is included in the condition? “if you are not a Senior OR you are on the soccer team or you are in band then…”
    • That means that non seniors and soccer players and band members are included
  5. Write the condition for a number being a multiple of 15.
    • It sets a temp variable to value 1 but also sets value 1 to value 2. Then, it sets value 2 to temp. This also causes a loop.