Input, Output
And Math
Real Life: Input/Output
Real Life: Variables
Course Credit You Need (Variable) | Course you enrolled in (assigned value to variable) |
Language | English |
Science | Biology |
Math | Data Management |
Real Life: Debugging
Answer: Debugging. Everyday you asses results and correct to get a desired outcome.
Sidebar with commands
all color coded
Switch between code, costumes
and sounds
Area for
your code
Start and stop
your code
See what you
see
Sprites
Add Sprites
Backgrounds
Code
Output in Scratch
Input in Scratch
Variables in Scratch
Creating a Variable
Variable Names
Input and Output in Scratch
Notice how he blocks are all color coded and match the same colors we looked at earlier?
Try the join command. How does it change the output?
Math
Basic arithmetic is available in Scratch:
Remember that Order of Operations (BEDMAS) applies to what you are doing. You can use brackets to ensure calculations are done in the order you want.
In Scratch, each of the operator "bubbles" is like a set of brackets.
Math
(2 - 3) + 4
See how you can add commands within bubbles? These act like brackets. For example: (3+4) / (2−5)
Example
Ask the user to enter 2 numbers and then display the sum.
Assignment Operator
Assignment To Same Variable