Page 133 - Touchpad_Plus_V3.2_Class 8
P. 133

3.   Write an if condition to display “Exam today” or “No exam on weekend” if it is a weekday today or
                       your exam.

                       .....................................................................................................................................................................................................

                       .....................................................................................................................................................................................................


                       .....................................................................................................................................................................................................

                       .....................................................................................................................................................................................................

                 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
                        )



                                                                                        Algorithmic Intelligence     131
   128   129   130   131   132   133   134   135   136   137   138