using flowcharts. sample flowchart (without text) 2

10
Using Flowcharts

Upload: warren-harris

Post on 16-Dec-2015

225 views

Category:

Documents


3 download

TRANSCRIPT

Using Flowcharts

Sample Flowchart (without text)

2

Terminator

Starts and ends a process

Only one flow, either departing or entering

START

STOP

3

Process

Contains calculation or process

Can contain a sequence of consecutive operations

Has a single flow entering and a single flow exiting

Calculate average Sum = A+B+C

Ave = Sum/3

4

Decision

Condition whose result causes one of multiple calculations or processes

Stated as question with only YES or NO as answer

One flow entering and two flows exiting

Is A > B?

Yes

No

5

Input/Output

Read input or write output

Only one operation, but can have multiple inputs or outputs

One flow entering and one flow exiting

Read A,B,C

6

Connector

Brings together separate flows that are coming together to perform the same operation

Multiple flows entering, one flow exiting

Note there is no “disconnector”

7

Let us try an example 8

We want to build a program to calculate the salary of a finical consultant

We need to read the working hours and hourly rate from the consultant

Calculation: Hours*Pay Rate

Output: the gross pay

Quiz : Draw Flowchart

Let’s write a flowchart to detail the process of a user logging into a computer account

What’s the first step? Determine input and output Input: userid and password Output: one of three situations:

Accepted

Incorrect userid

Incorrect password

Please use PowerPoint to finish this quiz and upload your answer to blackboard system.

9

So what are our steps?

INPUT userid and password CALL check of userid

DECISION: is userid valid? No, send message to user and exit

Yes, continue

CALL check of password, passing userid

DECISION: OK? No, send message to user and exit

Yes, send message of success and exit

10