Page 61 - Digicode_AI_class_7
P. 61

Look at these examples:
                   Example 1:                                         Example 2:


                   If                                                 Read marks
                        It is Maths class                             If marks is > 50
                   Then                                                    Display Pass
                        Take out Maths book & notebook                Else
                                                                           Display Fail


                   Example 3:                                         Example 4:

                   If                                                 If
                        It is raining                                      Number is divisible by 2
                   Then                                               Then
                        Carry an umbrella                                  Print “The number is EVEN”
                   Else                                               Else
                        Do not carry an umbrella                           Print “The number is ODD”



                                                                                 Critical Thinking
                   code Quest



                 A.  'If' an event occurs, 'then' what happens? Complete the sentences.
                     1.  If the fire alarm rings then                              .
                     2.  If the referee blows the whistle then                               .

                     3.  If the traffic light is red then                            .
                     4.  If I am sick then                               .
                     5.  If a cell phone battery charge is 0 then                              .

                        Else                                .
                     6.  If the CAPS LOCK key is ON then                                 .
                        Else                                .

                 B.  Write an example of a condition from real life.

                                                             If
                                                Yes                      No
                                                Then                     Else















                                                                                 Algorithmic Intelligence   59
   56   57   58   59   60   61   62   63   64   65   66