Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 65 - 2617_JSSPS_C-4
P. 65

    OPERATORS BLOCKS

                     Operators Blocks are used to do arithmetic and logical calculations. Blocks in the Operators
                     category are oval and hexagon in shape. These blocks are colour-coded as light green.

                     Arithmetic Operators

                     Scratch  has  four  operators that  allow  you  to
                     do arithmetic calculations. These are addition,                          Addition
                     subtraction, multiplication and division.  Look at

                     the code to use addition block.
                     Similarly, you can use the other blocks to perform subtraction                 , multiplication
                     and division          .

                     Relational Operators
                     Scratch has three operators that allow you to

                     compare the relationship between two values                              greater than
                     or variables. It will compare two numbers and
                     decide whether it is true or false. These are

                     greater than, less than and equals to.
                     Look at the code to use greater than block.

                     Similarly, you can use the other blocks to perform less than                           and equals to
                                .

                     Logical Operators

                     Using logical operators, you can combine two or more relational operators to produce a single
                     true/false result. These blocks allow you to further refine your comparison of values.

                                                       The result is true only if the two expressions are true

                                                       The result is true only if either of the expressions is true

                                                       The result is true only if the expression is false

                                                                                        Advance Features of Scratch-3  63

| 60 61 62 63 64 65 66 67 68 69 70 |