Page 27 - Touchcode_C8_Flipbook
P. 27

Step 3:  Select ‘set number to 0’ block and drop it to the ‘on
                            start’ block.

                  Step 4:  From ‘Logic’ select ‘if-else’ block and drop it to the
                            ‘on start’ block below the ‘set number to 0 ‘ block.

                            Click on ‘+’ to add one more ‘else’ block.
                  Step 5:  From ‘Logic’ select the ‘comparison’ block and drop it to the ‘true’ of ‘if-else’ block.


                  Step 6:  From ‘Math’ select the ‘remainder of’ block and drop it to the first ‘0’ of ‘comparison’
                            block.

                  Step 7:  In first ‘0’ of ‘remainder’ block, drag and drop the variable ‘number’ and in the
                            second ‘1’ of remainder block change the number from ‘1’ to ‘7’.

                  Step 8:  From ‘Logic’ select the ‘comparison’ block and drop it to the ‘true’ of ‘else-if’ block.

                  Step 9:  From ‘Math’ select the ‘remainder of’ block and drop it to the first ‘0’ of ‘comparison’
                            block.

                  Step 10: In first ‘0’ of ‘remainder’ block, drag and drop the variable ‘number’ and in the
                            second ‘1’ of remainder block change the number from ‘1’ to ‘9’.





















                  Step 11: From ‘Logic’ select ‘if-else’ block and drop it to the ‘if’ block.

                  Step 12: From ‘Logic’ select the ‘comparison’ block and drop it to the ‘true’ of ‘if-else’ block.
                  Step 13: From ‘Math’ select the ‘remainder of’ block and drop it to the first ‘0’ of ‘comparison’

                            block.

                  Step 14: In first ‘0’ of ‘remainder’ block, drag and drop the variable ‘number’ and in the
                            second ‘1’ of remainder block change the number from ‘1’ to ‘9.

                  Step 15: From ‘Game’ select the ‘splash’ block. Write the message ‘Number is divisible by
                            both 7 and 9’. Drop the ‘splash’ block in ‘if’ section.





                                                                                       Get Creative with Loops   25
   22   23   24   25   26   27   28   29   30   31   32