Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 83 - 2612_Digimind
P. 83

    ARITHMETIC OPERATORS
                     Scratch has four operators that allow you to do arithmetic calculations. These are addition,

                     subtraction, multiplication and division.

                           Operator                Meaning                              Examples

                                                                       when  clicked
                                +            Addition                  say  The sum of 100 + 50 is  for  2  seconds

                                                                       say  100 +  50

                                                                       when  clicked
                                -            Subtraction               say  The Difference between 100 and 50 is  for  2  seconds

                                                                       say  100 -  50

                                                                       when  clicked
                                *            Multiplication            say  The Product of 10 and 20 is  for  2  seconds

                                                                       say  100 *  20

                                                                       when  clicked
                                /            Division                  say  The Answer of 200/10 is  for  2  seconds

                                                                       say  200  /  10

                     COMPARISON/RELATIONAL OPERATORS

                     Scratch  has  three  operators  that  allow you  to  compare  the  relationship  between  two
                     values or variables. It will compare two numbers and decide whether it is true or false.
                     Comparison operators are used with the if... then block.

                           Operator                Meaning                              Examples

                                                                       when   clicked
                                                                             50
                                >  50        Greater than              if   100  >  50  then
                                                                        say  100 is greater than 50

                                                                                                     Blocks in Scratch  81

| 78 79 80 81 82 83 84 85 86 87 88 |