Basic Flowcharting

























1.

2.


3.
4.   -
5.


6.

    System Flowchart)


       Program Flowchart)
             3

         10

    10




                  ?






    ◦

    ◦   -
    ◦   -
    ◦
2
            (System
flowchart)
               (Program
flowchart)














    100





    100

          = 0.5 *   *
= 0.5 *   *




















    (decision table)







       American National Standard
    Institute (ANSI)  International
    Standard Organization (ISO)
START
                            1.
               STOP
                            2.
              read name
(Terminal)
             display area   1.

                                 name
                            2.
C=A+B
                                  1.         A
             Sum = 0
                                       +B

                                       C
(Process)                 false
                                  2.
            i <= 10
                true                   sum
                      i                      0
                                                 i
print A             A




(Document   display A , B

)
                                A,
                            B
read A     A = Age



(Comment
)
                                A
             read A




(Manual
Input)
for i =1 to 100             i

             sum = sum + i     1
                                     1
                    i
                                             100
(Preparati
on)


                               sum           i
write A

                       A
               A


(In-Page
              A=3      A
connector)
                1
read A        1.          A

         punch B , C

                            1
                       2.
(Punch                      B,C
          punch
card)    bi b=1 ,                1
            …n
                                B1 ,
                            B2 , Bn
                                n
read ID ,      ID ,
             name
                       name


(Punched
tape)
(Magnatic
disk)
findGrade




                         findGra
(Predefine               de
Process)
(Auxiliary
Operation)
(Communic
ation Link)
      START


     read age

                    false
      age > 60
            true

    “You are old”



        STOP
START

     sum
     =0
    i = 1 to 10

     sum =
    sum + i
       i

      sum


      STOP








                (Sequence)
              /        /
  (Selection/Decision/Conditi
  on)
           (Iteration / Loop)

START


 A=5              A   5

 B=3              B   3
C=A+B     A       B
print C       C
 STOP
START


 A,B
          A, B
C=A+B
                 A       B
print C
                     C
 STOP





1.

                                        --> <                    >
2.                                       --> <
               >
     -----------------------------------------------------
                                      :<                     >
                  :<                    >
3.
     ◦
     ◦
4.
     ◦   Last_meter
     ◦   Curr_meter
     ◦   Num_meter
     ◦   Electric_fee
5.
     1.
     2.             last_meter    curr_meter

     3.       num_meter = curr_meter –
        last_meter
     4.       electric_fee = num_meter * 2.5
     5.        num_meter , electric_fee
     6.
START



            Last_meter ,
             Curr_meter



Num_meter = Curr_meter – Last_meter



   Electric_fee = Num_meter * 2.5



      Num_meter , Electric_fee



               STOP
    (IF - THEN)
   (IF – THEN - ELSE)
     (IF – THEN – ELSE IF | CASE)
START


 read age               age

  age > 60
                false   age
        true

“You are old”
                              Y


    STOP
ans

       GoodLuck   ans = “GoodLuck”




Welcome Manager         Welcome
                      Manager
          Exit
Password System       Exit Password
                      System

                 %


    1.
    2.
     -       =       (   10/100)
    3.   =
    4.
    5.
START                           A


          read                      bonus = salary * 3
       name ,salary


                          false     Name , salary ,
        salary < 5000
                                       bonus
                true

salary = salary + (salary*10/100)         STOP



               A
   IF – THEN
IF      THEN
  BEGIN
               ;
               ;
 END;
IF       THEN

ELSE
 BEGIN
                ;
                ;
 END;

   sex =1

                                                      Male
          False                   True              sex =1
                      Sex = 1


                                                      Female
Female = Female + 1             Male = Male +1
START


                read age                      age
        false                  true
                  age > 60                   age

“You are young”              “You are old”
                                                    Yo
                                                    Yo



                   STOP
Do you like Pascal
                                                                 Do you like Pa
                                    ans                           ans
                         ans = „y‟ OR ans=„Y‟
                                                                      ans
I‟m sorry to hear that                            Thank You
                                                               -
                                                               Thank you
                                                               -
                                                               I’m sorry to hear t
                                 Good Bye
                                                              Goodbye


         %                         5000
             5%

    1.
    2.                    < 5000
     -                      = 10/100
     -                      = 5/100
    3.                =     +(         *
                  )
    4.        =
    5.
    6.
START                                        A


                    read                           salary = salary+(salary * rate)
                 name ,salary


       false                      true                  bonus = salary * 3
                 salary < 5000

rate = 5 / 100                   rate = 10 / 100
                                                        Name , salary ,
                                                           bonus


                      A                                        STOP

                       False          True


            False              True


    False           True
Score = mid + final


                                                  false                 true
                                                          Score >=80


                                   false                  true
                                           Score >=70                  Grade = ‘A’

                   false                   true
                            Score >=60                  Grade = ‘B’

      false                 true
              Score >=50                 Grade = ‘C’

Grade = ‘F’                Grade = ‘D’

Score = mid + final



                                  score




  80..100       70..79               60..69       50..59     0..49


Grade = ‘A’   Grade = ‘B’      Grade = ‘C’    Grade = ‘D’   Grade = ‘F’

    (Controlled Loop)
                       (Pre-
    Test Condition)
                        (Post-
    Test Condition)





    Next
     N        1                  1
           5
    Next
       N

                   For N =1 , 5




                    Print N


                      Next





           False

    True
                    N <=
                             N=1
    5
    ◦       N
    ◦   N       1 (N=N+1)
                                       False
                             N <=5

                                True

                            Print N


                            N = N+1





    False


            True
◦        N
    ◦    N       1            N=1


                N
    >5
                             Print N


                             N = N+1


                     False
                              N>5

                                 True

Flowchat

  • 1.
  • 2.
  • 3.
  • 4.
    1. 2. 3. 4. - 5. 6.
  • 5.
    System Flowchart) Program Flowchart)
  • 6.
    3 10 10 ?
  • 7.
  • 8.
    ◦ ◦ - ◦ - ◦
  • 9.
    2  (System flowchart)  (Program flowchart)
  • 10.
  • 11.
    100
  • 12.
  • 13.
    100 = 0.5 * *
  • 14.
  • 15.
  • 16.
    (decision table)
  • 17.
      American National Standard Institute (ANSI) International Standard Organization (ISO)
  • 18.
    START 1. STOP 2. read name (Terminal) display area 1. name 2.
  • 19.
    C=A+B 1. A Sum = 0 +B C (Process) false 2. i <= 10 true sum i 0 i
  • 20.
    print A A (Document display A , B ) A, B
  • 21.
    read A A = Age (Comment ) A read A (Manual Input)
  • 22.
    for i =1to 100 i sum = sum + i 1 1 i 100 (Preparati on) sum i
  • 23.
    write A A A (In-Page A=3 A connector) 1
  • 24.
    read A 1. A punch B , C 1 2. (Punch B,C punch card) bi b=1 , 1 …n B1 , B2 , Bn n
  • 25.
    read ID , ID , name name (Punched tape)
  • 26.
  • 27.
    findGrade findGra (Predefine de Process)
  • 28.
  • 29.
  • 30.
    START read age false age > 60 true “You are old” STOP
  • 31.
    START  sum =0 i = 1 to 10 sum = sum + i i sum STOP
  • 32.
  • 33.
    (Sequence)  / / (Selection/Decision/Conditi on)  (Iteration / Loop)
  • 34.
  • 35.
    START A=5 A 5 B=3 B 3 C=A+B A B print C C STOP
  • 36.
    START A,B A, B C=A+B A B print C C STOP
  • 37.
     1. --> < > 2. --> < > ----------------------------------------------------- :< > :< >
  • 38.
    3. ◦ ◦ 4. ◦ Last_meter ◦ Curr_meter ◦ Num_meter ◦ Electric_fee
  • 39.
    5. 1. 2. last_meter curr_meter 3. num_meter = curr_meter – last_meter 4. electric_fee = num_meter * 2.5 5. num_meter , electric_fee 6.
  • 40.
    START Last_meter , Curr_meter Num_meter = Curr_meter – Last_meter Electric_fee = Num_meter * 2.5 Num_meter , Electric_fee STOP
  • 41.
    (IF - THEN)  (IF – THEN - ELSE)  (IF – THEN – ELSE IF | CASE)
  • 43.
    START read age age age > 60 false age true “You are old” Y STOP
  • 44.
    ans GoodLuck ans = “GoodLuck” Welcome Manager Welcome Manager Exit Password System Exit Password System
  • 45.
    %  1. 2. - = ( 10/100) 3. = 4. 5.
  • 46.
    START A read bonus = salary * 3 name ,salary false Name , salary , salary < 5000 bonus true salary = salary + (salary*10/100) STOP A
  • 47.
    IF – THEN
  • 48.
    IF THEN BEGIN ; ; END;
  • 49.
    IF THEN ELSE BEGIN ; ; END;
  • 50.
  • 51.
    sex =1 Male False True  sex =1 Sex = 1 Female Female = Female + 1 Male = Male +1
  • 52.
    START read age age false true age > 60 age “You are young” “You are old” Yo Yo STOP
  • 53.
    Do you likePascal Do you like Pa ans ans ans = „y‟ OR ans=„Y‟ ans I‟m sorry to hear that Thank You - Thank you - I’m sorry to hear t Good Bye Goodbye
  • 54.
    % 5000 5%  1. 2. < 5000 - = 10/100 - = 5/100 3. = +( * ) 4. = 5. 6.
  • 55.
    START A read salary = salary+(salary * rate) name ,salary false true bonus = salary * 3 salary < 5000 rate = 5 / 100 rate = 10 / 100 Name , salary , bonus A STOP
  • 56.
    False True False True False True
  • 57.
    Score = mid+ final false true Score >=80 false true Score >=70 Grade = ‘A’ false true Score >=60 Grade = ‘B’ false true Score >=50 Grade = ‘C’ Grade = ‘F’ Grade = ‘D’
  • 58.
  • 59.
    Score = mid+ final score 80..100 70..79 60..69 50..59 0..49 Grade = ‘A’ Grade = ‘B’ Grade = ‘C’ Grade = ‘D’ Grade = ‘F’
  • 60.
    (Controlled Loop)  (Pre- Test Condition)  (Post- Test Condition)
  • 61.
    Next
  • 62.
    N 1 1 5 Next N For N =1 , 5 Print N Next
  • 63.
    False True
  • 64.
    N <= N=1 5 ◦ N ◦ N 1 (N=N+1) False N <=5  True Print N N = N+1
  • 65.
    False True
  • 66.
    N ◦ N 1 N=1  N >5 Print N N = N+1 False N>5 True