0% found this document useful (0 votes)
19 views

03 Flowcharts

The document describes flowcharts and their components. It provides examples of flowcharts that show: [1] the steps to find the sum of three numbers, [2] the steps to find the sum and product of two numbers, and [3] the steps to calculate a student's final grade and determine if they passed or failed. Flowcharts use standard symbols like rectangles, diamonds, and ovals to visually represent the logic and sequence of operations in an algorithm or program.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views

03 Flowcharts

The document describes flowcharts and their components. It provides examples of flowcharts that show: [1] the steps to find the sum of three numbers, [2] the steps to find the sum and product of two numbers, and [3] the steps to calculate a student's final grade and determine if they passed or failed. Flowcharts use standard symbols like rectangles, diamonds, and ovals to visually represent the logic and sequence of operations in an algorithm or program.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 7

FLOWCHARTS

The Flowchart

• A graphical representation of the sequence of operations in an information system


or program.

• Program flowcharts show the sequence of instructions in a single program or


subroutine. Different symbols are used to draw each type of flowchart.

• shows logic of an algorithm

• emphasizes individual steps and their interconnections


What are those symbols?

• START/END (Oval)

• INPUT/OUTPUT (Parallelogram)

• PROCESS (Rectangle)

• DECISION (Diamond)

• Directions
Example

START Question: Write an algorithm to find the sum


of three given numbers?
Input
N1,N2,N3

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

START Question: Write an algorithm to find the sum


and product of the two given numbers?
Input
N1,N2
Algorithm:

Sum=N1+N2 Step 1: Input N1,N2


Product=N1*N2 Step 2: Sum=N1+N2
Step 3: Product=N1*N2
Display Sum
Step 4: Print Sum
Display Product
Step 5: Print Product

STOP
Example

START Question: Find the sum and average of three


given numbers?
Input
N1,N2,N3
Algorithm:
Step 1: Input N1,N2,N3
Sum=N1+N2+N3 Step 2: Sum=N1+N2+N3
Average=Sum/3 Step 3: Average=Sum/3
Step 4: Print Sum
Display Sum
Step 5: Print Average
Display Average

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

You might also like