Monday, September 6, 2010

Flowchart

Flowchart Example
Here is a simplified example of a flowchart for a program that calls a number for you until someone answers and says "Hello" for you. You'll notice at the beginning and the end there is the racetrack shaped symbol:

Terminal Symbol


This is called the terminal symbol and denotes the beginning and end of a program.



After the terminal symbol you should notice the parallelogram shape:



Input/Ouput Symbol

This is the input/ouput symbol. Anytime a new constant or variable needs to be input or output, use this symbol. Here we use it to input phoneNumber and ouput the phrase "Hello".




Next in the flowchart is the plain rectangle shape:


Processing Symbol

Here is the processing symbol. This is where something is done, input is used, and/or data is manipulated. Here we use it to call the input phoneNumber.


The final shape looks like a diamond:

Decision Symbol

The diamond shape denotes the decision symbol. Here the computer checks to see if a statement is true or false and acts on that truth value as you have determined. Here we have said if the phone is not answered then call again. If it is, then the program finishes by saying "Hello" and ending.

Note: The does not equal could have also been written as !=, <>, or simply "does not equal". This is your preference. Sometimes using does not equal makes it easier to understand what the program, rather than using "= no."

Note 2: Yes and no can be denoted as 1 and 0 respectively.

No comments:

Post a Comment