Page 65 - Touchcode_C5_Flipbook
P. 65

D.  Write the result for the following conditions if num1 is 200                             Time Taken
                      and num2 is 400.                                                                  Min.

                        1       If (num1 > 250) OR (num2 > 250)


                                Then
                                      Write “TEA”

                                Else

                                      Write “COFFEE”



                        2       If (num1 > 250) AND (num2 > 250)

                                Then

                                      Write “TEA”
                                Else

                                      Write “COFFEE”



                        3       If (num1 < 250)

                                Then

                                      Write “TEA”

                                Else

                                      Write “COFFEE”



                 E.   Look at the program carefully and write the outputs                                     Time Taken
                      according to the values given in the table.                                       Min.



                        If (A is odd) AND (A < 40)                                 A                  Output

                        Then                                                       26
                                                                                   56
                             Print A x 3
                                                                                   90
                        Else If (A is odd)
                                                                                   33
                             Print A x 5
                                                                                   17
                        Else
                                                                                   10
                             Print A x 6


                                                                         Level 4: Algorithmic Intelligence       63
   60   61   62   63   64   65   66   67   68   69   70