Title: Flowcharting Skills
1Flowcharting Skills
- Visually Representing
- Process Logic
2Why Do Flowcharting?
- Economically expresses process logic A
picture is worth a thousand words. - Independent of implementation
- Physical or logical processes
- Supports any programming environment
- Works well for technical and non-technical
people.
3Where does Flowcharting Fit in Systems
Development?
- During Analysis to document current process
logic. - During Design to communicate specified process
logic to the implementation/construction staff. - During Implementation to document procedures and
processes.
4Consider Some Examples
5Problem 1
- Dave Smarsh wants to find out how much money he
will have in his savings account after a certain
number of years (the balance). - He knows
- The amount he will deposit
- the interest rate he will receive
- the number of years he will be save his money
- Assumption interest is compounding
- Develop a flowchart to calculate and print the
balance in a savings account.
6Think Like A ComputerOutline the Process
- First
- Input the Data
- Second
- Perform the Algorithm
- (Logic and Calculations)
- Third
- Output the Results
7Understand the Algorithm (Logic and
Calculations)
- After one year the balance is
- Balance Deposit (1 Rate/100)
- After the second year
- New Balance Old Balance (1Rate/100)
- New Balance Deposit (1Rate/100)2
- After year n
- Balance Deposit (1 Rate/100) n
8Order (Precedence) of Math Operations
- Programs use algebra rules
- Avoids unnecessary characters in formulas
- Complex formulas can be on one line
Z (2012)3/15
9Order Operations
- Do Everything within parentheses first.
- Inner parentheses takes precedence over outer
parentheses - The power operator () takes precedence over
multiply () divide (/). - Multiply () divide (/) take precedence over
addition () and subtraction (-). - Consider the formula
- Balance Deposit (1 Rate/100) n
10Order of Operations Visually
11Try Some Operations Precedence Problems
12Remember the Flowcharting Process
- First
- Input the Data
- Second
- Perform the Algorithm (Calculations)
- Third
- Output the Results
- How can we visualize this process?
- Use A Flowchart!!
13Flowchart Symbols
- Start/End
- Input/Output
- Process/Computation
- Decision
- Connector
- Logic Flow
14Problem 1
- Dave Smarsh wants find out how much money he will
have in his savings account after a certain
number of years (the balance). He knows how much
he is going to deposit, the interest rate that he
will receive, and the number of years that he
will be saving his money. (Assume that the
interest is compounding). - Develop a flowchart to calculate and print the
balance in a savings account.
151 Solution
START
INPUT Deposit, Rate, No.Years
BALANCE Deposit (1 Rate/100) No.Years
PRINT Deposit, Rate, No.Years, Balance
This Program Control Structure is called
SEQUENTIAL
FINISH
16Problem 2
- Captain Beefnut, the proud owner of Beefnut
Doughnut Shop, needs a program that will
calculate and print bills for his customers. - His usual price for doughnuts is 60 cents each,
but in order to increase sales he has reduced the
price to 40 cents each if a customer buys 12 or
more. - Develop this in a flowchart form.
172 Solution
This Program Control Structure is called
SELECTION or Decision
18Consider an Extension
- Suppose Captain Beefnut wanted his program to
repeat the algorithm if there was another
customer bill to calculate. Add a loop which
will accomplish this change.
192 with loop
This Program Control Structure is called
LOOPING or ITERATION or REPETITION
20Try Some Other Flowcharting Examples