Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 93 - 2632_CodeMind
P. 93

    test Your skiLLs

                      1.   Tick ( ) the correct option.

                          a.  Which type of block runs a code a specific number of times?
                              (i)  forever block                               (ii)  while block

                             (iii)  break block                                (iv)  repeat block

                          b.  The forever loop is mainly used for:

                              (i)  Running code only once

                              (ii)  Running code until a condition becomes false
                             (iii)  Repeating an action a specific number of times

                             (iv)  Continuously running a block of code without stopping

                          c.   The break statement is used to:

                              (i)  Skip to the next iteration of a loop

                              (ii)  Exit a loop before it completes

                             (iii)  Repeat a block of code a specific number of times

                             (iv)  Continuously run a block of code without stopping

                          d.  Parameters in a function are:
                              (i)  Actual values passed to the function

                              (ii)  Variables defined in the function's definition

                             (iii)  Loops that run continuously

                             (iv)  Statements that exit loops early

                          e.  In MakeCode Arcade, functions are used for:

                              (i)  Repeating blocks of code                    (ii)  Stopping loops
                             (iii)  Organizing and reusing code                (iv)  Changing the flow of loops

                      2.  Fill in the blanks using the words given below:
                                                      Forever, Loop, While, Function, Break

                          a.                     runs a statement or group of statements multiple times till the given condition
                              is true.

                          b.  The                    loop runs if a specified condition is true.

                      92    Premium Edition-VIII

| 88 89 90 91 92 93 94 95 96 97 98 |