Page 63 - Dig_CodeAI_V2.1_Class_7
P. 63

4.  What is IF-THEN-ELSE  condition?






                    5.  Write an IF condition to print “picnic” if it is Sunday today otherwise print “School”.
















                                                                                        Critical Thinking
                                                                                        Flexibility

                   A.  Read the pseducode and colour the boxes.

                        READ number                             4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
                                                                4                                               4
                        IF (number is 1) THEN colour Blue
                                                                4       2 2 3 3 1 1                             4
                        IF (number is 2) THEN colour Green
                                                                4       2 2 3 3 1 1                             4
                        IF (number is 3) THEN colour Yellow     4                  2 2 1 1 3 3                  4

                        IF (number is 4) THEN colour Purple     4                  2 2 1 1 3 3                  4
                                                                4                            2 2 1 1            4
                                                                4                            2 2 1 1 3 3        4
                                                                4                                       3 3     4
                                                                4                                               4
                                                                4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4

                     B.  Write the IF-THEN-ELSE condition to check if a number is divisible by 3 or not.





























                                                                                     Algorithmic Intelligence   61
   58   59   60   61   62   63   64   65   66   67   68