Page 20 - Touchcode_C7_Flipbook
P. 20

2                                            SEQUENCING WITH


                                                                                BLOCK CODING








                          Learning Outcomes

                       Introduction                                  Recap of Loops
                       What is Sequencing?                           Examples of Sequence, Selection and Iteration

                       What is a Bug?                                Types of Loops
                       Nested Loop                                   Apply Loops and Conditionals with Sequencing

                       Is There a Better Way to Apply Sequencing?




                  INTRODUCTION
                  In the previous class, you have learned about loops. In this chapter, you are going to learn
                  about sequencing and why it is important to follow sequencing in programming.


                  RECAP OF LOOPS
                  A loop is a block of code which executes multiple times till a specific condition is met.

                  Benefits:

                      Reduces lines of code.
                      Code becomes easier to understand.

                  Increment Loops

                  While running a loop, you need to set a condition and its number of iterations. Whenever
                  the condition is true, the block of code executes, this is counted as one iteration. Moving
                  to the next iteration, you need to increase the count of iteration to two. This is called as
                  incrementing a loop.


                  WHAT IS SEQUENCING?
                  A sequence in programming is an ordered set of instructions to be followed in order to

                  complete a task or to solve a problem. In case, if you follow the wrong order, then the task
                  cannot be achieved, or you may get the unexpected results.

                  Example  of  sequence  is  an  algorithm,  (Detailed  step-by-step  process to  be  followed  to
                  complete a task or to solve a problem).







                   18     Touchcode-VII
   15   16   17   18   19   20   21   22   23   24   25