Page 90 - TrackpadV5.1_class8
P. 90

d.  Which of the following results true if both conditions are true?
                          (i)  AND                                         (ii)  OR

                         (iii)  NOR                                        (iv)  NAND
                  2.  Fill in the blanks using the words from the help box.

                                                   condition, conditional, else, if


                      a.   Conditional statements in a program instruct the computer to make a decision based on a given
                         _______________.

                      b.   The statements written after the _______________ condition in a program are executed when the
                         condition is true.
                      c.   In a program, the statements following _______________ are executed when the condition specified
                         in the 'if' statement is false.
                      d.  There are two types of loops counting loops and _______________ loops.

                  3.  Think and answers.

                      a.   How do loops help us?
                         ____________________________________________________________________________________

                      b.   Write an if condition to display “We have a match on Sunday” or “No, match on Sunday” based on
                         whether today is Sunday and if there is a cricket match.
                         ____________________________________________________________________________________
                         ____________________________________________________________________________________

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

                         ____________________________________________________________________________________
                         ____________________________________________________________________________________

                         ____________________________________________________________________________________
                         ____________________________________________________________________________________
                  4.  Write the output of the following programs:

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

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



                   88   Pro (V5.1)-VIII
   85   86   87   88   89   90   91   92   93   94   95