Presentation is loading. Please wait.

Presentation is loading. Please wait.

Asking Questions in BYOB Scratch.

Similar presentations


Presentation on theme: "Asking Questions in BYOB Scratch."— Presentation transcript:

1 Asking Questions in BYOB Scratch

2 What is a variable? A variable is the way a computer remembers information. If you want the computer to remember something, you create a variable. Use simple, meaningful names. For example: if I want the computer to remember my name I’d create a variable called name. If I want it to keep track of points I earned in a game I could make a variable called score.

3 Special variables BYOB Scratch comes with some ready-made variables you can use. These are called system variables. Things like x-position and y-position of a Sprite

4 Making variables You can make a variable that only 1 sprite can access, or you can make variables that are accessible to every sprite in the program. You have to decide when you create the variable which kind you want.

5 Answer There is a system variable available in BYOB Scratch named answer that holds the answer to any question you ask of your user. <-- This is where you get the ask and answer blocks.

6 Asking questions The program below asks for a name and then greets the user by name. When you want to display an answer, you join it with words and the variable part will change with the user's answer. Answer is a fill-in-the-blank variable. This code will say "Hello Joe, how are you?" to Joe and "Hello Aliyah, how are you?" to Aliyah.

7 Join The more fill-in-the-blanks you have to say, the more joins you need to use The answer variable changes every time, but the words “Hello” and “, how are you?” will always stay the same. So 1 join block lets you choose 2 things to join, 2 joins put 3 separate things together.

8 Doing math You can build equations using the Math blocks
You can use + - * (times) /(divide) This program will say how many days are in a given number of weeks

9 pseudocode The pseudocode for this program is: When the program starts
The sprite asks for the temperature in fahrenheit Subtract 32 from the answer, multiply by 5 then divide by 9 The sprite says “That is “ ______ “degrees celcius” (filling in the blank with the converted temperature)

10 Here are some answers The order is a little mixed up


Download ppt "Asking Questions in BYOB Scratch."

Similar presentations


Ads by Google