Page 97 - Touchpad_Plus_V3.2_Class 6
P. 97

B. Algorithm to find the smallest in two numbers A and B.
                 Step 1  Start.
                 Step 2  Read two numbers and store them in A and B.
                 Step 3  Compare number A and B. If A is less than B, print "A is smallest" and go to Step 5.

                 Step 4  Compare number A and B. If B is less than A, print "B is smallest" and go to Step 5.
                 Step 5  Stop.

                     DEFINING FLOWCHARTS

                 A flowchart is a type of graphical diagram that represents an algorithm. It is a set of instructions
                 that  can  be  followed  to  perform  a  specific  task,  workflow  or  process.  This  diagrammatic
                 representation illustrates a solution model to a given problem. Flowcharts are used in analysing,
                 designing, documenting or managing a process or program in various fields.

                 Flowcharts show the sequence of instructions in a single program. They play a vital role in
                 the field of programming. These are helpful in understanding the logic of complicated and
                 lengthy problems. Once a flowchart is drawn, it becomes easy to write the program in any
                 high-level language. Often we see that flowcharts are helpful in explaining the program to
                 others. Hence, it is correct to say that a flowchart is must for the better understanding of a
                 complex program.
                 Symbols used in Flowcharts

                 A flowchart uses specific geometrical shapes and directional arrows to represent a particular

                 task. A set of geometrical boxes represents the steps involved in the solution process. Each box
                 represents a specific function, activity, or process. Directional arrows are used to connect the
                 boxes to show the flow of the solution. Different symbols are used to draw different types of
                 flowcharts. Let us discuss them.

                   Symbol              Name                                    Description
                                   (Start/Stop)       It is used to show the start and stop points of the flowchart.
                                                      It usually contains the words 'Start' or 'Stop'.
                                      Process         It shows a process or action step. This is the most common
                                                      symbol used in flowcharts.
                                     Decision         It indicates a question or branch in the process flow. It is
                                                      used when there are 2 options (Yes/No).


                                  Input/Output        It represents  material or information entering or leaving
                                                      the system, i.e., input and output.

                                     Flow Line        It shows the direction in which the process flows.
                                      (Arrow,
                                    Connector)
                                    Connector         It is small and is used as a Connector  to show a jump
                                   (Inspection)       from  one  point  in  the  flowchart  to  another.  Connectors
                                                      are usually labelled in pairs to show matching jump points.



                                                                                       Algorithm and Flowchart       95
   92   93   94   95   96   97   98   99   100   101   102