Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 116 - 2609_Logicode
P. 116

    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 from the help box.
                                                   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.

                          c.                    loop is often used for actions that need to happen repeatedly without stopping.

                          d.                    statement is used to come out of a loop early when the specific condition is met.

                          e.                    help to organise code, make it reusable, and improve readability.

                      3.  Write 'T' for true and 'F' for false.

                          a.  Argument is the actual value passed to a function when it's called.

                          b.  The continue statement stops the loop from its execution.

                          c.   Jump statements in programming are used to change the flow of control by
                             skipping, starting again or exiting certain parts of the code.

                          d.   An argument is a placeholder for a value that will be passed later.

                          e.  The for loop allows for actions and tasks that repeat until certain conditions are met.

                      4.  Answer the following questions:

                          a.  What is the purpose of using loops in programming?

                       114  Premium Edition-VIII

| 111 112 113 114 115 116 117 118 119 120 121 |