Upload
solielmutya
View
295
Download
0
Tags:
Embed Size (px)
DESCRIPTION
Different flowchart symbols and examples.
Citation preview
FLOWCHARTS DECISION/ BRANCHING
Engr. Soliel G. MutyaDLSU-CSB
Minter2
COMPETENCY
Represent conditional statements using flowcharting.
ALGORITHM
It is a detailed sequence of simple steps that are needed to solve a problem.
FLOWCHART
A graphic representation of an algorithm.
Graphically depicts the logical steps to carry out a task and shows how the steps relate to each other.
Used during the design phase of programming to work out the logical flow.
BASIC FLOWCHART SYMBOLS
FLOWCHART SYMBOL
FLOWCHART NAME
FUNCTION
Terminator / Terminal Block
This symbol can only be seen at the beginning and end of the program.
Flow lines Defines logical sequence of the program. It gives the direction of logic flow.
Input / Output Block The inputting of data for processing, and printing out of processed data.
Process Block Manipulation of data (assignments and mathematical computation
BASIC FLOWCHART SYSMBOLSFLOWCHART SYMBOL
FLOWCHART NAME
FUNCTION
Decision Block Denotes a decision to be made. Process conditions using relational operators. Used for trapping and filtering data.
On-page Connector Connects to the flowchart to avoid spaghetti/redundant connection on the same page.
Off-page Connector Connects the flowchart on different page to avoid spaghetti/redundant connection.
Initialization Used to initialize a value; mostly used in looping process.
Flowcharting Guidelines
1. The flowchart should flow from the top to bottom.
2. If the chart becomes complex, utilize connecting marks.
3. Avoid intersecting flow lines.4. Use meaningful descriptions in the
symbol.
Sequential Structure
Input a,b
Sum=a+b
Ave=(sum/2)
Display Sum, Ave
start
End
EXAMPLE 1
Design a flowchart that will compute for the volume of a box. The box has 3 dimensions (L, W, and H).
Selection Structure
IF condition
ELSElogic
THENlogic
False
True
EXAMPLE 2
Create a flowchart that will input grade and determine if the student is “PASSED” or “FAILED”. Assume 75 and above is the passing mark.
Repetition Structure
Do-While Loop
IF conditio
n
ELSElogic
True
False
ELSElogic
IF conditi
on
Do-Until Loop
False
True
EXAMPLE 3
Create a flowchart that will display 11 to 20 using a looping control structure
EXAMPLE 4
Create a flowchart that will compute for the simple interest 5 times. Assume: Interest=Principal Value * Rate * Time.
EXAMPLE 5
Design a flowchart that will input two numbers and display the larger number entered.
ACTIVITY 5
1. Any customer whose total purchase is at least 1,000 Php will be given a 10% discount. Construct a flowchart with equivalent Pseudocode that will input the customer’s purchase and output his bill.2. Construct a flowchart and Pseudocode that will display MINTER2 ten times.3. Create a flowchart and Pseudocode that will enter hours and display if the employee has overtime hours if he exceeds 40 hours.4. Every leap year is divisible by 4. Design the flowchart and Pseudocode that will input YEAR and display whether the year is a “LEAP YEAR” or “ORDINARY YEAR”.
ASSIGNMENT 3
1. Design the flowchart with equivalent Pseudocode that examines the value of a variable called “temp” then display the following messages, depending on the value assigned to temperature:
TEMPERATURE MESSAGE
Less than 0 “It is an ICE”
Between 0 and 100 “It is a WATER”
Exceeds 100 “It is a STEAM”
ASSIGNMENT 32. A student grade may be calculated based on his score. Construct a flowchart with equivalent Pseudocode that will input score and display its equivalent grade.SCORE GRADE
Below 60 F
At least 60 but below 70 D
At least 70 but below 80 C
At least 80 but below 90 B
At least 90 A