Scratch Lab #6
Name: Matthew Moorehead
Date: October 29th, 2015
Assignment: Lab #6
The first problem was to make an etch a sketch on scratch. We had to use if statements to check for key presses. The final product was supposed to be a design which allowed the scratch user to make a sketch of what they want using the arrow and space keys.
To solve this, I first put in if statements and made sure that the line being drawn coulf be changed whenever the user wanted it to be. To do this, I made a repeat until statement and added all of the arrows that weren't used as well as the space bar. Then, I made it point in a certain direction and made it move 2 steps.
This problem asked us to make a sprite which asks the user to choose a word and the sprite would spell it out. We had to use if then statements so that if the word was greater than 10 letters it would ask for a new word.
To solve this problem, I added the if then statement and made is so that if the word was greater than 10 letters, it would say pick a new word, but if it wasn't it would spell it out by saying the specific letter of the answe. I put it on forever loop.
- What is the difference between and if and and if-else statement?
- And if statements only have one outcome which happens when the statement is true but and if then statements have two outcomes since there can be a false anser.
- Is there a simpler way to write the following code? Explain.
- Yes, you can add "move 10 steps" before the if then statement and make it only a if statement. Then say if mouse x=0, then say "My mouse is at zero!".
- 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…”
- The students described are juniors, sophomores, or freshman who are on the soccer team as well as anyone that is in the band.
- 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…”
- The snippet will have value 1 and value 2 be the same value instead of its intended outcome which is value 1 equals value 2 and value 2 equals value 1.
- Write the condition for a number being a multiple of 15.
- In this snippet, the value 1 and value 2 will be reversed and temp will be value 2, making the snippet work.