variables these are just objects that store information...

Post on 30-Apr-2020

1 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Step 1.

Step 2.

Step 3.

Make a variable, which is just an object that stores a value.

Name it ‘x’.

Make another variable, and name it ‘y’.

Choose the ‘when Sprite clicked control. Then make the cat say ‘hello’ and ‘Let’s do some math!

Variables – these are just objects that store information. Please follow the steps below to create two variables that add two numbers. Don’t skip steps! Have patience and you’ll get it to work in no time at all!!

K.Rusniak_10/19/12

Step 4.

Step 5.

Step 6.

Add the commands above to set ‘x’ and ‘y’ to ‘0’.

Replace the ‘0’ in each box with a green ‘pick random’ box.

Use the light blue ‘ask’ command to ask what is ‘x’ + ‘y’? This command lets you answer the question later.

Add an ‘if else’ condition.

K.Rusniak_10/19/12

Step 7.

Step 8.

Step 9.

Add an ‘=‘ operation.

Add a ‘+’ operation on the left of the ‘=‘ operation.

Add ‘x’ and ‘y’ to the left of ‘=‘.

K.Rusniak_10/19/12

Step 10.

Step 11.

Add the light blue ‘answer’ object on the right.

Now add some actions. Say ‘Great job!!’ in the first line and ‘Oops. Try again’ in the second.

Congratulations. You’re done. Your program should look like the final example above. Click on the cat to run your program. Type your answer in the box that appears below the cat and press the check mark to check your answer. Click the cat to play again. Now you know how to make the computer add numbers, and you created a game too! I hope you liked this project!

K.Rusniak_10/19/12

top related