Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 117 - 2609_Logicode
P. 117

    b.  Write the work of break statement within a loop.

                        c.  What are the benefits of using functions in programming?

                        d.  Write the steps to create a function.

                        e.  Write the process of creating a function in MakeCode Arcade.

                                                                                                  21 st   #Experiential Learning
                     5.  Competency-based/Application-based questions.                         Century   #Information Literacy
                                                                                                 Skills
                        a.   Swarna has written a program that has more repeated statements to do a same task, which makes
                            her code difficult to understand. She wants to reduce the number of lines of code in her program.
                            How can she do this?
                        b.   Maya is building a program to calculate and display the area of different shapes (rectangle, circle,
                            triangle). She currently writes separate code blocks for each shape’s area calculation. How can
                            Maya use a function to streamline her code and make it easier to update?
                        c.   A teacher wants to continue a quiz for students until all the questions are answered. Which type of
                            loop would be best for repeating the quiz?

                        d.   A developer needs to calculate the area of different geometric shapes such as squares, circles, and
                            triangles in multiple parts of their code. What should they use to avoid repeating the same code
                            each time?

                        e.   In a game, a player is searching for a key inside a maze. If the player finds the key, the game should
                            end. Which statement should be used to stop the search when the key is found?

                                                                                           Advanced MakeCode Arcade   115

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