Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 98 - 2607_Trackpad_Pro_5.1_flipbook_C4
P. 98

    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  10  * 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          Greater than               if    100  > 50    then
                                                                          say 100 is greater than 50

                       96   Premium Edition-IV

| 93 94 95 96 97 98 99 100 101 102 103 |