Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 135 - 2615_KEC
P. 135

    2.  Variables: These blocks used to create and store data in an
                        app.  Variables are  used  to  store  information  that  the  app
                        needs while it runs. They can remember numbers, text or any
                        value that may change during the execution of the app.

                       Common Variable blocks include:
                          var (create variable)

                          Assign value

                          Update variable

                                                       3. Math: These blocks are used for arithmetic and numeric

                                                         calculations.  These blocks  perform calculations  such
                                                         as addition,  subtraction,  multiplication  and division.
                                                         They can also be used for generating random numbers
                                                         and  applying mathematical  functions  like  rounding  or
                                                         calculating square roots.

                                                         Common Math blocks include:
                                                            Addition, subtraction, multiplication, division

                                                            Random number
                                                            Math functions (round, abs, sqrt, etc.)

                     4.  Control: These blocks are used to repeat actions in your app.

                        Loops allow actions to be repeated automatically, saving time
                        and reducing the  need  for extra  code.  You  can set  them  to
                        repeat a task a specific number of times or continue repeating
                        as long as a condition remains true.
                       Common Control blocks include:

                          for loop             while loop                timedLoop

                                                       5. Function: These blocks are used to create reusable code.
                                                         Functions allow you to group code into reusable chunks.

                                                         By using functions, you can keep your program organised
                                                         and reduce repetition.

                                                         Common Function blocks include:
                                                            Create function
                                                            Call function

                                                            Functions with parameters

                                                                             Designing User Interfaces and Simulating Data  133

| 130 131 132 133 134 135 136 137 138 139 140 |