Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 78 - 2632_CodeMind
P. 78

    5                                         Advanced

                                                           MakeCode Arcade

                         Let’s surf

                         Ø  What are Control Structures?                   Ø  Loops
                         Ø  Jump Statements                                Ø  Functions

                                                                                                      21 st
                      Let’s PLug-in                                                                 Century   #Critical Thinking
                                                                                                      Skills
                       Write an algorithm to check whether a number is prime or not. (Hint, Prime numbers are those
                       which are divisible by itself or 1.)

                     In the previous class, you have learnt what are variables, data types in programming, sequence, loop, bug,
                     event and collections. In this chapter, you will learn about loops and functions.

                            WHAT ARE CONTROL STRUCTURES?

                     A control structure in programming is a fundamental construct that directs the flow of execution within
                     a program based on certain conditions or criteria. So, the control structure is a basic decision-making
                     process in computing. There are three main types of control structures:

                     •   Sequential: Statements in a program are executed sequentially or step-by-step in an order in which the
                       instructions are written.
                     •   Selection/Conditional: It is used to test a condition in a program. It takes decision to execute one
                       statement/operation over another statement/operation depending on the condition.

                                                                                           Advanced MakeCode Arcade    77

| 73 74 75 76 77 78 79 80 81 82 83 |