Page 40 - IT_V5.0_Class6
P. 40

Rules to Draw Flowcharts

                  You must follow these basic rules while drawing a flowchart:
                      Maintain the direction of the flow from left to right or top to bottom.
                      Only one flow line should come out from a process box.

                      Only  one  flow  line  should  enter  a  decision  box,  but  two  flow  lines  should  leave  the
                     decision box.
                      Ensure that the flowchart has a logical start and end.
                  Look at the flowchart to calculate simple interest.

                                                                 Start


                                                          Read P for Principal
                                                                   r for rate
                                                                   t for time



                                                                Calculate
                                                           SI = (P * r * t)/100



                                                                Print SI



                                                                 Stop

                     SOLVING PROBLEMS USING ALGORITHMS AND FLOWCHARTS

                  Some examples are given below to solve the problems using algorithms and flowcharts:

                  Example 1: Write an algorithm and draw a flowchart to check whether a given number is
                  even or odd.
                                  Algorithm:                            Flowchart:
                  Step 1:  Start.                                          Start
                  Step 2:  Read Number.
                  Step 3:  Check If Number % 2 == 0 Then              Read a Number

                            print "Number is even."
                            Else
                            print "Number is odd."                           Is
                                                                                          Yes
                                                                      Number%2==0?             Print Number is even
                  Step 4:  Stop.


                                                                               No

                                                                    Print Number is odd




                                                                           Stop



                    38    Information Technology (V5.0)-VI
   35   36   37   38   39   40   41   42   43   44   45