Professional Documents
Culture Documents
Flow Charts The Funadametals How To Make One
Flow Charts The Funadametals How To Make One
JERRY ESPERANZA
Objective
The module was designed to achieve the following; 1. Identify flowcharting symbols. 2. Use flowchart symbols in identifying steps/pseudocode in logic formulation. 3. Formulate flowchart solutions. The material used a problem-direct solution approach. Instead of defining each flowchart symbol first, we applied it on situation when we need it and define it on the sidelines. What covered on this material are program flowcharts. System flowcharts are designed to show interface between input/output devices, to other systems, and the program itself. It uses other specialized symbols which are beyond the coverage of this courseware. Though new tools are being introduced in software development, flowcharting is still one of the effective tools in presenting the logic/idea of program execution. Students of Computer Science or related IT courses will benefit on this courseware as one prepares career as Scientist, Analyst, Programmer or Project Manager. We encourage everyone to give us feedback on how you find this material so we may improve it. You may reach us at thrivingJerry@yahoo.com. Visit also our blogsite: http://ThrivingAndLiving.blogspot.com .
http://ThrivingAndLiving.blogspot.com
Terminal symbol is required to use at start and end of flowchart * Flowline indicates the direction of the next instruction or sequence of available information and executable operation. It is used with an arrow at the end to denote direction.
Switch on UPS.
Process Box represents the process of executing a defined or group operations that result in a change value, form or location of information.
End
http://ThrivingAndLiving.blogspot.com
4. If signal = red 4.1 Press brake. 5. If signal = yellow 5.1 Prepare to stop.
* Decision box branches to the next instruction depending on the result of condition. ** On-page connector used to direct at the next instruction WITHIN the page. Label it either by letter or number or combination of both.
* Signal = green? **
Continue driving. C
Signal = red?
Press brake.
Signal = yellow?
Prepare to stop.
N
C End
http://ThrivingAndLiving.blogspot.com
Solution 2 We can solve the same problem using a different approach. No need to test if the signal is yellow. We can logically assume that if it is not green, two conditions would remain: either red or yellow. Green is tested first; red next. Therefore, neither green nor red, we proceed immediately to step when the color is yellow. Thus, we eliminate the condition of testing yellow.
Start
Signal = green?
Continue driving. C
Signal = red?
Press brake.
N
Prepare to stop.
End
http://ThrivingAndLiving.blogspot.com
Start
Initialization or preparation stores the start value of identifiers or variables at the start of the program
z= x+y
z < 10
N
End
Input/Output box used as an I/O function which makes data available for processing (input) or displaying (output) of processed information.
http://ThrivingAndLiving.blogspot.com
Solution:
Start
*
addNumbers
* Predefined process box represents a named process consisting of one or more operations or program steps that are specified elsewhere.
subtractNumbers
End
http://ThrivingAndLiving.blogspot.com
addNumbers A
x=0 y=0
y= y+1
Accept x
x= x+1
Accept y
RETURN
subtractNumbers
z = -4
z <-4
Y
z=z+2
N
z=z-1 z=z-1
1
Print the value of z.
Off-page connector is used to direct the next instruction located on ANOTHER page. Label it either by letter or number or combination of both. Page 1
RETURN
Page 2
http://ThrivingAndLiving.blogspot.com
start = 1 finish = 4
C
N
Display value of finish
start = start + 1
http://ThrivingAndLiving.blogspot.com
green?
NO!
YES
2. Decision box with three-outgoing branch. You may notice from other textbooks the use of 3-outgoing branch. Because this material is used as introduction to programming, stick with the use of 2-outgoing branch for now. The decision box on this case is designed only to answer conditions with YES or NO; TRUE or FALSE.
YES
NO
NO
NO!
YES
http://ThrivingAndLiving.blogspot.com
10
3. Too many end terminal symbols. Flowchart designers who are lazy to route the next step to END often create more than one terminal symbol. Remember always that you are only allowed to have one set of START/END terminal symbols in a flowchart. Again, you may correct this error by using flow lines or connectors.
Signal = green?
Y Continue driving.
Signal = green?
Y Continue driving.
End N N
Signal = red?
Y Press brake.
Signal = red?
Y Press brake.
N A
End
End
NO!
YES
http://ThrivingAndLiving.blogspot.com
11
Problem Exercises
I. Design a flowchart based from the given tasks. Problem A. Initialize x and y with value 0. Store 10 to x. Store -3 to y. if y<x 4.1 Display x is greater than y 4.2 Display value of x. 5. Display value of y. 1. Initialize age with a value of 0. 2. Accept age. 3. if age<18 3.1 Print Minor: you cannot vote. 4. if age >= 18 4.1 Print Your age is eligible to vote. 5. if age >= 65 5.1 Print Senior Citizen: Vote wisely. Our future is at stake. Initialize num with value 0. Display Enter a number. Accept num. if num>0 4.1 Display Number is positive. else 4.2 if num<0 4.2.1 Display Number is negative. else 4.2.2 Display Number is origin. 5. Display value of num. 1. Initialize inputGrade and grade with value 0. 2. Accept inputGrade. 3. if inputGrade <= 100 3.1 if inputGrade >= 98 3.1.1 grade = 1.0 4. if inputGrade <= 97 4.1 if inputGrade >= 95 4.1.1 grade = 1.25. 5. if inputGrade <= 94 5.1 if inputGrade >= 91 5.1.1 grade = 1.5. 6. if inputGrade < = 90 6.1 if inputGrade >= 89 6.1.1 grade = 1.75. else 6.2.1 if inputGrade <= 88 and inputGrade >= 86 6.2.1.1 grade = 2. else 6.2.1.2 grade = 5. 7. Print the value of grade. 12 1. 2. 3. 4. 1. 2. 3. 4.
Problem B.
Problem C.
Problem D.
http://ThrivingAndLiving.blogspot.com
II.
Formulate your own flowchart that will solve the following problems.
1. Show steps on how to withdraw money from ATM. Include situation of what to do when machine captures your ATM card. 2. Design a modularize approach of how to convert Celcius to Farenheit temperature and vice versa. The user enters a temperature and later asked on what temperature conversion will it make. Compute and display the converted temperature value. Use the following formula in conversion: Celcius = 5/9 * (Farenheit -32) Farenheit = 9/5 * Celcius + 32 3. Write a flowchart that will display message Programming is fun! 10 times. Your flowchart should be flexible enough to handle change of number of times the message is displayed: you only need to change the value 10 into either 5, 15, 100 or 1000 and nothing more.
http://ThrivingAndLiving.blogspot.com
13