Page 71 - Touchcode_C8_Flipbook
P. 71

5                              ADVANCED SEQUENCING












                         Learning Outcomes

                      Introduction                                       What is a Sequence?
                      What is a Bug?                                     Sequencing with Loops and Conditions





                 INTRODUCTION

                 So far, you had a basic understanding of how a computer works and how instructions are
                 followed in a program. You have also learned about the loops and how they are used for
                 sequencing. In this chapter you are going to learn about advanced sequencing.

                 Consider the following example:

                                                                                                     Subject Enrichment
                  Example: Making a Sandwich

                  To make a sandwich you will:
                      get two slices of bread, jam and butter.

                      spread jam on one slice of bread.
                      spread butter on other slice of bread.
                      put the two pieces of bread together.



                 If you miss any step then the result will be different from the expected one. But is it really
                 so simple? Where’s the bread? How do you “spread”? How do you put the two pieces of
                 bread together? You know how to do these things, but try telling a computer how to make

                 a sandwich! When you write an algorithm for a computer, you have to be very specific, and
                 you have to speak the computer’s language. You do this by using programming language.
                 Similarly, in programming, tasks need to be done in the correct sequence to get the desired
                 output. In this chapter you will learn what is a sequence, why it is important?


                 WHAT IS A SEQUENCE?
                 A sequence in programming is an ordered set of instructions or tasks. In case, if you
                 follow the wrong order, then the task cannot be achieved, or you may get the unexpected

                 results.



                                                                                        Advanced Sequencing      69
   66   67   68   69   70   71   72   73   74   75   76