03 Flowcharts
03 Flowcharts
The Flowchart
• START/END (Oval)
• INPUT/OUTPUT (Parallelogram)
• PROCESS (Rectangle)
• DECISION (Diamond)
• Directions
Example
Algorithm:
Sum=N1+N2+N3 Step 1: Input N1,N2,N3
Step 2: Sum=N1+N2+N3
Step 3: Print Sum
Display
Result
STOP
Example
STOP
Example
STOP
Example
START
Question: Write an algorithm to determine a
student’s final grade and indicate whether it is
Input
M1,M2,M3,M4
passing or failing. The final grade is calculated
as the average of four marks.
GRADE=(M1+M2+M3+M4)/4
Algorithm:
Step 1: Input M1,M2,M3,M4
N IS Y Step 2: GRADE =(M1+M2+M3+M4)/4
GRADE<50 Step 3: if (GRADE < 50) then
Print “FAIL”
else
Display
“Pass”
Display
“Fail”
Print “PASS”
endif
STOP