Page 89 - TrackpadV5.1_class8
P. 89

PURE       Research shows coding  activates  brain areas  tied  to  memory,  attention,  and
                      FACT       language, boosting learning.






                                          1.   Which construct allows a program to execute a block of code repeatedly
                                             as long as a certain condition is met?
                                                   a. Variable assignment                    b. Loop
                                          2.  What is the result when using the "AND" condition in a program?

                                                   a. True only if both conditions are true
                                                   b. True if either of the conditions is true
                                          3.  What type of loop repeats a certain number of times?
                                                   a. Conditional loop                       b. Counting loop

                         uiz   Bee        4. Conditional loops in a program repeat until:
                                                   a. A fixed number of times

                                                   b. A certain condition is reached




                      REVISIT



                   ▶   Conditional statements are used in a program to instruct the computer to make a decision.
                   ▶   A loop allows a set of instructions or a block of code to be executed repeatedly.
                   ▶   When a loop repeats forever (endlessly), it is called an infinite loop.












                 1.  Tick ( ) the correct option.

                    a.  The result of the computer’s decision for a _______________ will always be either true or false.
                         (i)  loop                                        (ii)  condition
                        (iii)   Expression                               (iv)  Function

                    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

                        (iii)  Infinite loop                             (iv)  Finite Loop



                                                                                            Algorithmic Intelligence  87
   84   85   86   87   88   89   90   91   92   93   94