Page 116 - CodePilot V5.0 C4
P. 116

LOGICAL OPERATORS

                  These operators are used to combine two or more conditions. The operator checks
                  if the conditions are true or false and gives the outcome.


                                                     This block checks if both conditions are true. It returns
                                       and
                                                    true if both are true and false if one or both are not.

                                                     This block checks if either of the two conditions is true.
                                        or
                                                    If at least one is true, it returns true, else it returns false.


                                                     This block  is used  to  reverse the result of a given
                                        not
                                                    condition.


                  For example, let’s create the given script:







                                 when   clicked
                                 if    100 >  50  and  100 >  60  then

                                    say  True, 100 is greater than 50 and 60
                                 else

                                    say  False, 50 and 60 is not greater than 100





                                                                                                  21 st
                       INTERDISCIPLINARY LEARNING                                               Century   #Critical Thinking
                                                                                                 Skills
                    Create a script to solve the given question: The robot has 228 gifts to pack and it can place 12
                    gifts in each box. The robot needs to figure out how many full boxes are needed.

                    Hint: Use the division operator.








                          PEN BLOCKS


                  Pen blocks let your sprite draw on the stage. It is used to create shapes, lines and

                  drawings in your project. These blocks are dark green in colour. The Pen blocks need
                  to be added to the block palette before they can be used.






                  114     CodePilot (V5.0)-IV
   111   112   113   114   115   116   117   118   119   120   121