Page 78 - Touchcode_C6_Flipbook
P. 78

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:   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
                             increase the value by 1. Each time loop completes one iteration, and you will hear

                             music once.

                  ENTRY CRITERIA

                  Entry criteria is a condition that must be true, met, or fulfilled before a specific task can begin.
                  These criteria can vary depending on the program's requirements.

                  Let’s understand the concept of entry criteria with a real-life example—starting a bike.

                  To start a bike, you need petrol in the fuel tank. If the fuel tank is empty, the bike won’t start.

                  So, in this case, the entry criterion for starting the bike is that the fuel tank must not be empty.

                  EXIT CRITERIA

                  A looping condition must become false at some point; otherwise, the block of code will
                  enter an infinite loop. To prevent this, it is essential to define an exit criterion for the loop.

                  An exit criterion is a condition that must be met before a specific task is completed. It is a
                  set of conditions that must be fulfilled before declaring a program complete.

                  Exit criteria can vary from program to program depending on the requirements.

                  Example of Exit Criteria:


                   76     Touchcode-VI
   73   74   75   76   77   78   79   80   81   82   83