CL4 CH5 Addition-Bot-2
CL4 CH5 Addition-Bot-2
SESSION 5
Addition Bot
In this activity, we learn how to make perform arithmetic operations in Coding. We will create the
calculator which adds two numbers.
MATERIAL REQUIRED
□ Computer / Tab / Laptop with PictoBlox Installed.
ARITHMETIC OPERATORS
There are four main arithmetic operators in PictoBlox:
Addition, Subtraction, Multiplication, and Division.
ASKING A QUESTION
To make the sprite ask a question, we will use an ask
block from the Sensing palette. It will ask the user
whatever you write inside it, wait for user input, and
then store that input in the answer block.
STEP-BY-STEP
Follow the steps below:
1. Create a New file in PictoBlox.
1.1 Open PictoBlox and create a new file.
1.2 Select the coding environment as Block Coding.
2. Click the Choose a Backdrop button. Select the Forest backdrop
from the library.
3. Add two ask () and wait blocks to get the input from users for
Number 1 and Number 2. Using the ask () and wait block will add
an input box (with the specified text above it) at the bottom of the
Stage. The user can write the answer and submit it, which is then stored in the answer block.
STEP 4
STEP 5
6. Place another set () to () block at the end and choose Result from its drop-down. Place a () + () block
(addition Operator block) in the white space and add Number 1 and Number 2.
7. Make Tobi say the result out loud using the say () for () seconds block.
8. Complete the script by adding a when flag clicked block.
FINAL SCRIPT