Page 138 - TP_Prime_V2.2_Class8
P. 138

b.   A loop is used to execute instructions or a block of code ____________ times.
                         (i)  two                                               (ii)  three

                         (iii)  multiple                                        (iv)  ten

                      c.   What is an endless loop called?

                         (i)  Counting loop                                     (ii)  Conditional loop
           Prime (Ver. 2.2)-VIII         d.   Which of the following results true if both conditions are true?
                                                                                (iv)  None of these
                         (iii)  Infinite loop


                         (i)  AND
                                                                                (ii)  OR

                         (iii)  Both (i) and (ii)

                                                                                (iv)  None of these

                    Evaluation Time


          136     1.  Fill in the blanks using the hints given below:

                                               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.

                  2.  Short answer type questions.
                      a.  How do loops help us?

                      b.  Define the OR operator.

                  3.  Long answer type questions.

                      a.   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.

                      b.   Write an if condition to display “Exam today” or “No exam on weekend” if it is a weekday
                         today or your exam.
                                                                                                      21 st
                  4.  Competency-based/Application-based questions.                                 Century   #Critical Thinking
                                                                                                      Skills
                      a.   Lokesh has created a program in which he has written blocks of code multiple times to cover

                         the path ten times if a given condition is true. What can he use to reduce the lines of code
                         in his program?
   133   134   135   136   137   138   139   140   141   142   143