Page 79 - CloudGPT_C8_Flipbook
P. 79

Step 3:  Change the value of '4' to '10' in the 'repeat' block.
















                  Step 4:   In 'Music', select 'Play sound until done', it will appear on the workspace, and
                            then drag and drop the 'Play sound until done', block in the 'repeat' block.
















                  Step 5:   Your code will be:













                  Step 6:   When you click on the 'Start the simulator' button, you will hear the music 10 times.
                            The loop repeats itself 10 times. The flow starts with 1 and with each iteration, it

                            increments the value by 1. Each time loop completes once iteration, and you will hear
                            music once.

                 ENTRY CRITERIA

                 Entry criteria is a check for a looping condition, which needs to be true to ensure that the
                 loop runs.

                 Entry criteria is a condition which must be true or must met or must exist before starting
                 a specific task. Criteria can be different from program to program as per the requirement.

                 Let’s understand the concept of entry criteria, by taking an example of starting a bike.
                 To start a bike you need petrol in the fuel tank. If your fuel tank is empty your bike won’t start.

                 So, in this case the entry criterion to start the bike is that the fuel tank should not be empty.

                                                                                     Loops Using Block Coding    77
   74   75   76   77   78   79   80   81   82   83   84