Page 19 - Touchcode_C8_Flipbook
P. 19

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 ‘5’.
                  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 ‘5.

                  Step 15:  From ‘Game’ select the ‘splash’ block. Write the
                            message ‘Number is  divisible  by  both  4  and  5’.
                            Drop the ‘splash’ block in ‘if’ section.
                  Step 16:  Again, From ‘Game’ select the ‘splash’ block. Write
                            the message ‘Number is divisible by 4 only’. Drop
                            the ‘splash’ block in ‘else’ section.

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

                  Step 20:  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 ‘4’.
                  Step 21:  From ‘Game’ select the ‘splash’ block. Write the message ‘Number is divisible by both 5
                            and 4’. Drop the ‘splash’ block in ‘if’ section.
                  Step 22:  Again, From ‘Game’ select the ‘splash’ block. Write the message ‘Number is divisible by
                            5 only’. Drop the ‘splash’ block in ‘else’ section.

                  Step 23:  From ‘Game’ select the ‘splash’ block. Write the message ‘Number is divisible by neither
                            5 nor 4’. Drop the ‘splash’ block in ‘else’ section.




                                                                                        Conditionals in Details  17
   14   15   16   17   18   19   20   21   22   23   24