Flow Chart

November 16, 2021 Posted by Pasindu Sathsara

     FLOW CHART


  • Flowcharts can be used to represent algorithms visually, they use Diagram which use particular symbols to show the flow of data, processing and input/output that takes place within a program or task.
  • The image below shows that standard flowchart symbols that we use,


WHEN TO USE A FLOWCHART


  • To develop understanding of how a process is done
  • To study a process for improvement
  • To communicate to others how a process is done
  • When better communication is needed between people involved with the same process
  • To document a process
  • When planning a project


Main Flow Chart Structurers 



  1. Sequence structure
  2. Selection structure
  3. Reptation structure 
 

Sequence Structure

A sequence structure is a simplest flowcharting construction. 

Example :-

A program is to be developed allows to user enter  two number and final output is shown to sum of these numbers. 

We can write a algorithm above question like what is given below.

Algorithm

Step 1 :- Start

Step 2:- Enter 1st number (A)

Step 3 :- Enter 2nd number (B)

Step 4 :- Sum = A+B

Step 5 :- Print Sum

Step 6 :- End

We can show that code flow chart 




Selection Structure

The selection control structure allows one of see of statement to be executed if a condition is true and another set of action to be executed if a condition  is false.  

Example :-

Think a program is to be developed allows to user enter number and check  whether  if user entered number is Even number print "This number is even number" otherwise print "This number is not even number". We have to write code that problem through selection method.  

Algorithm

Step 1 :- Start

Step 2:- Enter 1st number (A)

Step 3 :- If  A/2 %0 then

Step 4 :- print("This number is even number") 

Step 5 :- else

Step 6 :-  print("This number is not even number") 

Step 7 :- End





Reptation Structure


Repetition structures are used to repeat statements or blocks of code. The decision whether to repeat the code is based on the evaluation of a logical expression. If the expression is true, the code is executed. If false, the code is not executed

      Example :-


Write an algorithm and  flow chart using reptation structure  follow this question. Think  you have to print  0 to10 numbers so  get the right program structure using above method. 

Step 1 :- Start

Step 2:- Set C = 0

Step 3 :- If  C<=10

Step 4 :- print(C) 

Step 5 :- C = C+1

Step 6 :- Stop