Page 115 - TP_Play_V2.1_class8
P. 115

E.  Write the output of the following programs:

                    1.   Repeat 5 times
                                                               Num1     4      7      87     45     22
                        {
                                                               Num2     7      5      34     32     90
                            READ Num1
                                                               Print
                            READ Num2

                            IF Num1 > Num2 THEN
                                PRINT “Num1 is greater”
                            ELSE
                                PRINT “Num2 is greater”
                        }

                    2.  Repeat 5 times
                                                               Marks    45    40     55     49     85
                        {
                                                               Result
                            READ Marks
                            IF Marks > 50 THEN
                               PRINT "Pass"
                            ELSE
                                PRINT "Fail"
                        }

                    3.  Repeat 5 times                 start
                        (
                            Put a cross
                            Move 1 right
                            Put a tick
                            Move 1 down
                        )



                 F.  Read the program and do as directed.
                    1.  Repeat 4 times
                        (                              start
                          Colour Yellow
                          Skip One Triangle
                        )


                    2.  Repeat 6 times                 start
                        (
                           Put a cross
                           Move 1 right
                           Move 1 down
                         )






                                                                                     Algorithmic Intelligence    113
   110   111   112   113   114   115   116   117   118   119   120