Page 139 - TP_Prime_V2.2_Class8
P. 139

b.   Your sister Vidhya wants to display “Yes” or “No” for a year to be both a leap
                        year and a century year. But she is unable to do so. Write the program for

                        her.

                    Activity Time

                                                                                                     21 st
                                                                                                   Century   #Critical Thinking
                 1.  Write the output of the following programs:                                    Skills

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

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

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


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




                     d.  Repeat 5 times                                                start
                         (
                            write “8”
                            Move 1 step left
                         )
   134   135   136   137   138   139   140   141   142   143   144