ERASMUS SCRATCH PROJECT NAME: GREEK TEAM
Working on Operations
How to we can use Scratch GRADE: ANY
to do basic operations
DIFFICULTY FROM 1 TO 10: 4
Math Worksheet: Operations with Scratch
The purpose of current worksheet is to present how we can use Scratch to do basic
math operations.
Scenario: The cat sprite is the basic object in the application. Cat is going to ask the user to
do simple math operations, add or multiply two numbers addition and multiplication. At
the end of the specific worksheet, the application can be easily extended for division and
subtraction. The final application can also be changed for bigger numbers.
1. We need two variables, (Variables are used to store information to be
variable 1 for first number referenced and manipulated in a computer
and variable 2 for the second program. They also provide a way of labeling data
number. We also need a with a descriptive name, so our programs can be
variable to count the number understood more clearly by the reader and
of right answers (score). ourselves. It is helpful to think of variables as
containers that hold information. Their sole
purpose is to label and store data in memory. This
data can then be used throughout your program. )
2. Add first variable for first
number
Click on data tab
Ralleia Experimental Primary Schools – Evangelia Petraki 1
[Link] Variable 1
Click on Make a Variable
Type 1 for Variable name
Click OK
Follow the steps 2 and 3 to add
the Variable 2 and the score.
4. Drag and drop the When
Green Flag clicked Event into
Script area
5. Set score to zero
Click data
Drag and Drop into script
the Set score to 0 block
Ralleia Experimental Primary Schools – Evangelia Petraki 2
6. The cat “says” a message
Click on Looks
Drag and drop into scripts
the say Hello for 2 secs
block
Write your message
7. Drag and drop into scripts the
forever block
Click on Control
Drag and Drop the
forever block
8. We are going to set to variable
1 a random number from 1 to
10. Scratch provides a function
for this, the pick random 1 to 10
function in operators tab. Each
function returns a value. So we
are going to set the random
number to variable 1.
Click data tab
Drag and drop into script
the Set … to 0 block
Click operators tab
Drag and drop text box
with 0 value the pick
random 1 to 10 function
9. Do the same for Variable 2
Ralleia Experimental Primary Schools – Evangelia Petraki 3
10. Ask user to do the first
operation
Drag and drop into script
the Ask … and wait block
from sensing tab
[Link] the message with
Variable 1 X Variable 2 operation
(multiplication) 11a)
11a) From operators tab drag
and drop the join operator twice
11b) Put second join into “world” 11b)
text box
11c) from data tab drag and drop
the 1 and 2 variables in the 11c)
correct text box and write the
multiplication symbol X.
11d) Replace the message in ask
block
11d)
Ralleia Experimental Primary Schools – Evangelia Petraki 4
12. Use If block to check if the
user’s answer is correct
Drag and drop into script
the if … then … else block
Create the condition by
using answer from
sensing tab, = and *
operations from
operators tab
If the answer is correct
the cat says a message
and increase the score
(use change score by …
block from data tab
If the answer is wrong the
cat says “Wrong”
13. Move the cat by using the
glide block from motion tab
14. follow the same steps to add
a question for addition
a) You will find the specific application in the following link
[Link]
b) You can add division and subtraction operations to your scratch project
c) You can change the numbers in pick random 1 to 10 function if you want to
create a project that handles bigger numbers.
Links
[Link]
[Link]
Ralleia Experimental Primary Schools – Evangelia Petraki 5
We can improve this program together. Show your contributions:
Ralleia Experimental Primary Schools – Evangelia Petraki 6