Page 113 - Computing E-Book Grade 7
P. 113

The City School  2021-2022




             5.1.  Overview


            Computer programming is a way of giving

            computers instructions about what they should
            do next. These instructions are known as code,

            and computer programmers write code to solve
            problems or perform a task.

            The end goal is to create something: that could
            mean anything from a web page, or a piece of

            software, or even just a pretty picture. That’s
            why computer programming is often described

            as a mix of art and science; it’s technical and
            analytical, yet creative at the same time.


            5.2.  Flowcharts and Algorithms



            Algorithms and flowcharts are two different tools used for creating new programs,
            especially in computer programming. An algorithm is a step-by-step analysis of the

            process, while a flowchart explains the steps of a program in a graphical way.


             Algorithms

            To write a logical step-by-step method to solve                  Making a PB&J Sandwich

            the problem is called an algorithm. In other                           undo the twist tie
                                                                                   get out two slices of bread
            words, an algorithm is a procedure for solving                   get out two slices of bread
                                                                                   place them on a plate
            problems. In order to solve a mathematical or                          open the jelly jar
                                                                                   scoop them out with a knife
            computer problem, this is the first step of the                  spread jelly on one slice
                                                                                   wipe off the knife
                                                                                  open the peanut butter jar
            procedure. An algorithm includes calculations,                         scoop some out with a knife
                                                                             spread peanut butter on the other
            reasoning and data processing. Algorithms can                          set the knife down
                                                                                   pickup each of the slices
                                                                                   keep the dry sides on the outside
            be presented by natural languages, pseudocode                    put the slices together
                                                                                   place the sandwich back down
            and flowcharts, etc.                                                  pick the knife back up again
                                                                                   cut the sandwich into two halves



















                                                                                                                113
   108   109   110   111   112   113   114   115   116   117   118