flowchart
TRANSCRIPT
![Page 1: flowchart](https://reader035.vdocument.in/reader035/viewer/2022081413/54704905b4af9fc92d8b464c/html5/thumbnails/1.jpg)
FLOWCHARTS
![Page 2: flowchart](https://reader035.vdocument.in/reader035/viewer/2022081413/54704905b4af9fc92d8b464c/html5/thumbnails/2.jpg)
The Flowchart
A graphical representation of the sequence of operations in an information system or program.
Information system flowcharts show how data flows from source documents through the computer to final distribution to users.
Program flowcharts show the sequence of instructions in a single program.
Different symbols are used to draw each type of flowchart.
![Page 3: flowchart](https://reader035.vdocument.in/reader035/viewer/2022081413/54704905b4af9fc92d8b464c/html5/thumbnails/3.jpg)
The Flowchart
A Flowchartshows logic of an algorithmemphasizes individual steps and their
interconnectionse.g. control flow from one action to the next
![Page 4: flowchart](https://reader035.vdocument.in/reader035/viewer/2022081413/54704905b4af9fc92d8b464c/html5/thumbnails/4.jpg)
Flow Charts
A flow chart can be used to:
Define and analyse processes. Build a step-by-step picture of the process
for analysis, discussion, or communication. Define, standardise or find areas for
improvement in a process.
![Page 5: flowchart](https://reader035.vdocument.in/reader035/viewer/2022081413/54704905b4af9fc92d8b464c/html5/thumbnails/5.jpg)
Flowchart Symbols
![Page 6: flowchart](https://reader035.vdocument.in/reader035/viewer/2022081413/54704905b4af9fc92d8b464c/html5/thumbnails/6.jpg)
Flow Chart Symbols
Denotes the beginning and end of the program.
OVAL
![Page 7: flowchart](https://reader035.vdocument.in/reader035/viewer/2022081413/54704905b4af9fc92d8b464c/html5/thumbnails/7.jpg)
Flow Chart Symbols
Denotes a process to be carried out.
Processing Function (Rectangle)
![Page 8: flowchart](https://reader035.vdocument.in/reader035/viewer/2022081413/54704905b4af9fc92d8b464c/html5/thumbnails/8.jpg)
Denotes an input/output operation.
Parallelogram
Flow Chart Symbols
![Page 9: flowchart](https://reader035.vdocument.in/reader035/viewer/2022081413/54704905b4af9fc92d8b464c/html5/thumbnails/9.jpg)
Denotes the decision or a branch to be made.
Decision Making and Branching
Flow Chart Symbols
![Page 10: flowchart](https://reader035.vdocument.in/reader035/viewer/2022081413/54704905b4af9fc92d8b464c/html5/thumbnails/10.jpg)
DECISION STRUCTURES
isA>B
Print B
Print A
Y N
![Page 11: flowchart](https://reader035.vdocument.in/reader035/viewer/2022081413/54704905b4af9fc92d8b464c/html5/thumbnails/11.jpg)
Denote the direction of the logic flow in the program.
Flow lines
Flow Chart Symbols
![Page 12: flowchart](https://reader035.vdocument.in/reader035/viewer/2022081413/54704905b4af9fc92d8b464c/html5/thumbnails/12.jpg)
Display
Information display by printers or plotters.
Flow Chart Symbols
![Page 13: flowchart](https://reader035.vdocument.in/reader035/viewer/2022081413/54704905b4af9fc92d8b464c/html5/thumbnails/13.jpg)
Flow Chart Symbols
Connector or joining of two parts of program
![Page 14: flowchart](https://reader035.vdocument.in/reader035/viewer/2022081413/54704905b4af9fc92d8b464c/html5/thumbnails/14.jpg)
Example
PRINT“FAIL”
START
InputM1,M2,M3,M4
GRADE=(M1+M2+M3+M4)/4
ISGRADE>50
PRINT“PASS”
STOP
YN
![Page 15: flowchart](https://reader035.vdocument.in/reader035/viewer/2022081413/54704905b4af9fc92d8b464c/html5/thumbnails/15.jpg)
Example 2
Draw a flowchart to convert the length in feet to centimeter.
![Page 16: flowchart](https://reader035.vdocument.in/reader035/viewer/2022081413/54704905b4af9fc92d8b464c/html5/thumbnails/16.jpg)
Example 2
START
InputLft
Lcm = Lft x 30
PrintLcm
STOP
![Page 17: flowchart](https://reader035.vdocument.in/reader035/viewer/2022081413/54704905b4af9fc92d8b464c/html5/thumbnails/17.jpg)
Example 3
Draw a flowchart that will read the two sides of a rectangle and calculate its area.
![Page 18: flowchart](https://reader035.vdocument.in/reader035/viewer/2022081413/54704905b4af9fc92d8b464c/html5/thumbnails/18.jpg)
Example 3START
InputW, L
A = L x W
PrintA
STOP
![Page 19: flowchart](https://reader035.vdocument.in/reader035/viewer/2022081413/54704905b4af9fc92d8b464c/html5/thumbnails/19.jpg)
Example 4
Draw a flowchart that will calculate the roots of a quadratic equation
Hint: d = sqrt (b2 – 4ac), and the roots are: x1 = (–b + d)/2a and x2 = – (b + d)/2a
2 0ax bx c
![Page 20: flowchart](https://reader035.vdocument.in/reader035/viewer/2022081413/54704905b4af9fc92d8b464c/html5/thumbnails/20.jpg)
Example 4START
Inputa, b, c
d = sqrt(b x b – 4 x a x c)
Printx1 ,x2
STOP
x1 = (–b + d) / (2 x a)
X2 = – (b + d) / (2 x a)
![Page 21: flowchart](https://reader035.vdocument.in/reader035/viewer/2022081413/54704905b4af9fc92d8b464c/html5/thumbnails/21.jpg)
Relational Operators
Relational Operators
Operator Description> Greater than
< Less than
= Equal to
Greater than or equal to
Less than or equal to
Not equal to
![Page 22: flowchart](https://reader035.vdocument.in/reader035/viewer/2022081413/54704905b4af9fc92d8b464c/html5/thumbnails/22.jpg)
Example 5
Write an algorithm that reads two values, determines the largest value and prints the largest value with an identifying message.
ALGORITHMStep 1: Input VALUE1, VALUE2Step 2: if (VALUE1 > VALUE2) then
MAX VALUE1else
MAX VALUE2endif
Step 3: Print “The largest value is”, MAX
![Page 23: flowchart](https://reader035.vdocument.in/reader035/viewer/2022081413/54704905b4af9fc92d8b464c/html5/thumbnails/23.jpg)
Example 5
MAX VALUE1
Print“The largest value is”,
MAX
STOP
Y N
START
InputVALUE1,VALUE2
MAX VALUE2
isVALUE1>VALUE2
![Page 24: flowchart](https://reader035.vdocument.in/reader035/viewer/2022081413/54704905b4af9fc92d8b464c/html5/thumbnails/24.jpg)
Assignment 1
Draw a flowchart that reads three numbers and prints the value of the largest number.
![Page 25: flowchart](https://reader035.vdocument.in/reader035/viewer/2022081413/54704905b4af9fc92d8b464c/html5/thumbnails/25.jpg)
AlgorithmStep 1: Input N1, N2, N3Step 2: if (N1>N2) then
if (N1>N3) then MAX N1 [N1>N2, N1>N3]
else MAX N3 [N3>N1>N2]
endifelse
if (N2>N3) then MAX N2 [N2>N1, N2>N3]
else MAX N3 [N3>N2>N1]
endifendif
Step 3: Print “The largest number is”, MAX
![Page 26: flowchart](https://reader035.vdocument.in/reader035/viewer/2022081413/54704905b4af9fc92d8b464c/html5/thumbnails/26.jpg)
Example 6
Flowchart: Draw the flowchart of the above Algorithm.
![Page 27: flowchart](https://reader035.vdocument.in/reader035/viewer/2022081413/54704905b4af9fc92d8b464c/html5/thumbnails/27.jpg)
Example 7 Write and algorithm and draw a flowchart
to
a) read an employee name (NAME), overtime hours worked (OVERTIME), hours absent (ABSENT) and
b) determine the bonus payment (PAYMENT).
![Page 28: flowchart](https://reader035.vdocument.in/reader035/viewer/2022081413/54704905b4af9fc92d8b464c/html5/thumbnails/28.jpg)
Example 7
Bonus Schedule
OVERTIME – (2/3)*ABSENT Bonus Paid
>40 hours>30 but 40 hours>20 but 30 hours>10 but 20 hours 10 hours
$50$40$30$20$10
![Page 29: flowchart](https://reader035.vdocument.in/reader035/viewer/2022081413/54704905b4af9fc92d8b464c/html5/thumbnails/29.jpg)
Step 1: Input NAME,OVERTIME,ABSENTStep 2: if (OVERTIME–(2/3)*ABSENT > 40) then PAYMENT 50 else if (OVERTIME–(2/3)*ABSENT > 30) then
PAYMENT 40 else if (OVERTIME–(2/3)*ABSENT > 20) then PAYMENT 30 else if (OVERTIME–(2/3)*ABSENT > 10) then PAYMENT 20 else PAYMENT 10 endif
Step 3: Print “Bonus for”, NAME “is $”, PAYMENT
![Page 30: flowchart](https://reader035.vdocument.in/reader035/viewer/2022081413/54704905b4af9fc92d8b464c/html5/thumbnails/30.jpg)
Example 7
Flowchart: Draw the flowchart of the above algorithm?