Scratch Lab #6

Name: Robby Rowell

Period: 7

Assignment: Scratch Lab #6

Lab Overview

This lab required us to use conditional statements and operator blocks to account for different possible outcomes that could occur. For problem 1, we had to use a sprite to make an etch-a-sketch, where the sprite would follow our commands to draw on the screen. For problem 3, we had make a sprite that would spell back words we inputed, but only if they were only 10 letters or less. HERE.

My Solution

My solution to problem 1 was to put conditional statements for when the up arrow, down arrow, right arrow, left arrow, or space bar were pressed. These loops would repeat until any of the other keys were pressed. I made this using the Or operator blocks. Inside each of the Repeat Until conditional statements, the sprite would point in the direction pressed, and move in that direction with the pen down to draw. When the space bar is pressed, the sprite is sent to the origin and the screen is cleared. For Problem 3, I had the sprite ask ask for a word to spell. I created a conditional statement for whether the word is 10 letters or less. If the word is 10 letters or less, the sprite repeats back the letter one by one. If the word is over 10 letters, the sprite asks for a new word.

My Project Link

Questions

  1. What is the difference between and if and and if-else statement?
      An if statement only works if the input is true, whil an if-else statement has outputs for both true and false inputs.
  2. Is there a simpler way to write the following code?
      Yes. Since both outputs have the sprite move 10 steps, that command can be moved outside of the If-else conditional.
  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..."
      Freshmen, sophemores, juniors, or seniors who are in band or on 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…”
      It includes seniors who are on the soccer team or who are in the band.
  5. Write the condition for a number being a multiple of 15
      If 15 mod answer = 0, then