CSC 103 Flowcharts
CSC 103 Flowcharts
Flowcharts
CSC 103: Dr. Abdul Fattah Salman slide #1 Flowcharts
Flowchart Symbols
start/end
An algorithm is an ordered sequence of
steps to solve a problem. An algorithm
process may be represented using pseudo-code or
flowcharts.
A flowchart is a graphical representation
input/output of the algorithm. The commonly used
graphical symbols used in flowcharts are
shown.
Predefined process A flowchart in which operations flow in
one direction (top down) is called
sequential and usually doesn’t contain
decision decision symbols. It represents a
sequence code.
A flowchart containing a decision symbol
Flow lines & represents a code with selection or
connectors repetition structure.
CSC 103: Dr. Abdul Fattah Salman slide #2 Flowcharts
A Flowchart with Sequence
start
Question: Draw a flowchart that prompts
the user to enter from the KBD the length
and width of a rectangle then calculates Print “Enter
and prints the area and perimeter of len & wid”
rectangle.
read len, wid
finish
CSC 103: Dr. Abdul Fattah Salman slide #3 Flowcharts
A Flowchart with Selection
A flowchart is branching if it contains a start
decision symbol.
Question: Draw a flowchart that:
1) Prompts the user to enter from the KBD an Print “Enter bas
employee’s basic salary (BS) in BD and the sal & mon work”
number of months worked (MW).
2) Calculate the tax as shown in the table. read BS & MW
Basic salary Tax (percentage
in BD of basic salary) true
false BS > 500
≤ 500 5%
> 500 8%
3) Compute total salary:TS =(BS –TAX ) x MW. TAX = 0.05xBS TAX = 0.08xBS
4) Display the values of TAX and TS.