Algorithms and Flowcharts for Reference
Transcript of Algorithms and Flowcharts for Reference
7/26/2019 Algorithms and Flowcharts for Reference
http://slidepdf.com/reader/full/algorithms-and-flowcharts-for-reference 1/15
ALGORITHMS AND
FLOWCHARTSLesson 1
Lesson 2
Lesson 3
Lesson 4Lesson 5
7/26/2019 Algorithms and Flowcharts for Reference
http://slidepdf.com/reader/full/algorithms-and-flowcharts-for-reference 2/15
ALGORITHMS
ANDFLOWCHARTS
1.Algorithms
2.Flowcharts
.A!"a#tag$s a#!Limitatio#s
%.T&'$s o( )owcharts
*.Flowcharti#g t$m'lat$s
+.Flowcharti#g s&m,ols
L $ s s o #
1
-
2 2 .
7/26/2019 Algorithms and Flowcharts for Reference
http://slidepdf.com/reader/full/algorithms-and-flowcharts-for-reference 3/15
ALGORITHMS
List of instructions for carrying out some processstep by stepExample Recipe in a cookbook
Choreography for a classical ballet
In computer
!illion of steps of calculationControl of manufacturing process or coor"ination
#hat is your algorithms upon $aking up in themorning%
7/26/2019 Algorithms and Flowcharts for Reference
http://slidepdf.com/reader/full/algorithms-and-flowcharts-for-reference 4/15
FLOWCHARTS
Logical se&uence representation
'sing "iagrams
Combination of steps an" operations is performe"
Consists of labelle" geometrical symbols that areinterconnecte" to pro(i"e a pictorial representationof a "ata processing proce"ure)
*isual representation of an algorithm)
'se" by programmer an" other organi+ations
7/26/2019 Algorithms and Flowcharts for Reference
http://slidepdf.com/reader/full/algorithms-and-flowcharts-for-reference 5/15
A!"a#tag$s o(
)owcharts1) Language "epen"ent, can be learne" an"
applie" $ithout formal kno$le"ge of aprogramming language
2) Enforcement of focus to a signi-cant matterso(er less signi-cant ones
3) .ro(i"e alternati(e to a narrati(e "escription
of a system or program4) Easier to un"erstan"
7/26/2019 Algorithms and Flowcharts for Reference
http://slidepdf.com/reader/full/algorithms-and-flowcharts-for-reference 6/15
Limitatio#s o(
)owcharts1) Computer cannot accept a /o$chart0base"
program
2) Cannot be (ie$e" as a natural $ay ofcommunication
3) Certain "etails often re&uire longinterconnection
4) oes not con(ey # a gi(en set ofoperation is ma"e) nly #)
5) lo$charts "on6t highlight important "etails)
7/26/2019 Algorithms and Flowcharts for Reference
http://slidepdf.com/reader/full/algorithms-and-flowcharts-for-reference 7/15
Two t&'$s o(
)owcharts1) .rogram lo$chart 7raphically "escribes in "etails
2) 8ystem lo$chart Interaction bet$een har"$are soft$are an"
personnel
Little information is sho$n
7/26/2019 Algorithms and Flowcharts for Reference
http://slidepdf.com/reader/full/algorithms-and-flowcharts-for-reference 8/15
lo$chart 9emplate0use" to "ra$ /o$chart symbols
7/26/2019 Algorithms and Flowcharts for Reference
http://slidepdf.com/reader/full/algorithms-and-flowcharts-for-reference 9/15
Flowchart S&m,ols
1) Input:output 8ymbol ;.arallelogram<
2) .rocessing symbol ;Rectangle<
3) ecision symbol ;iamon"<
4) .reparation symbol ;exagon<
5) 9erminal symbol ;(al<
=) .re"e-ne" process symbol ;Rectangle $ith t$o(ertical bars)
>) n0page connecter ;8mall circle<
?) @0page connector ;8mall pentagon<
A) lo$ "irection in"icator ;Brro$hea"s<
1)lo$ lines ;ori+ontal:(ertical lines<
7/26/2019 Algorithms and Flowcharts for Reference
http://slidepdf.com/reader/full/algorithms-and-flowcharts-for-reference 10/15
/asicFlowchart
S&m,ols
7/26/2019 Algorithms and Flowcharts for Reference
http://slidepdf.com/reader/full/algorithms-and-flowcharts-for-reference 11/15
ALGORITHMS
ANDFLOWCHARTS
1.Drawi#g )owcharts
2.Notatio#s 0s$! i#
)owcharti#g.Ill0strati"$ 'ro,l$ms o#
sim'l$ logic )ow L $ s s o #
2
-
2 .
7/26/2019 Algorithms and Flowcharts for Reference
http://slidepdf.com/reader/full/algorithms-and-flowcharts-for-reference 12/15
sample /o$chart
.roblem sol(ing
B typical $orking "ays inthe oDce
the /o$ lines an""irections
$hat are the symbolsuse"%
ho$ symbols are use"%
89BR9
7 9#RF
9BFE BCEEREBF
7 !E
8!E#RF
I8 I9 9I!E 9 7!E%
I8 9E
88LFIG7%
89.
B
B
G
G
7/26/2019 Algorithms and Flowcharts for Reference
http://slidepdf.com/reader/full/algorithms-and-flowcharts-for-reference 13/15
NOTATIONS SD IN FLOWCHARTING
7/26/2019 Algorithms and Flowcharts for Reference
http://slidepdf.com/reader/full/algorithms-and-flowcharts-for-reference 14/15
Ill0strati"$ 'ro,l$m
3am'l$ A. 9he ra"ius of a circle is e&ual to oneunit) ra$ a /o$chart to compute thecorrespon"ing area of the circle an"print out the (alue of the ra"ius an" the
area)
B suitable algorithm for this problem$oul" be as follo$sH1) e-ne the (alue of the ra"ius ;R< an" .I;e&ual to 3)141=<)2) Calculate the area of the circle BREB .IJRJR)3) .rint out the ra"ius an" its correspon"ingarea)
89BR9
R 1)
.I 3)141=
BREB .IJRJR
EG
.RIG9 RBREB
7/26/2019 Algorithms and Flowcharts for Reference
http://slidepdf.com/reader/full/algorithms-and-flowcharts-for-reference 15/15
Ill0strati"$ 'ro,l$m
3am'l$ /.7i(en the numbers B an" C) ra$ a/o$chart that $oul" compute the sum thea(erage an" the pro"uct of these (alues)
B suitable algorithm for this problem $oul"be as follo$sH1) Rea" in (alues of B an" C)2) etermine the sum of the three (alues)3) Compute the a(erage by "i(i"ing the sum
by 3)4) !ultiply the -rst (alue to the secon" (alue
then by the thir" (alue to "etermine thepro"uct of the three (alues
5) .rint out the compute" (alues)
89BR9
EG
8'! BKKC
REB B C
B*E8'!:3
.RBJJC
.RIG98'!B*E.R