Have a look at the following blocks. What do you think will happen when they are executed? Do you think they will output the same values or different values? Have a guess and then try out the code for yourself!
Different computer languages handle calculations in different ways. In Scratch, it’s pretty straight forward:
Scratch always calculates the answer to the maths in the inner block first, and then works it’s way back out!
This is similar to how you use brackets in maths lessons.
So here is what the examples above would look like in a maths lesson!
Answer = 5 + ( 5/ 5)
Answer = (5 + 5) / 5
See if you can work out the answer to these maths questions.
Write down your answers and then them in Scratch.
Remember to work out the answers from the inside blocks first, then move outwards.