Flow Chart Symbols
Flow Chart Symbols
Note: In the examples below, assume that identifiers A and I represent integer variables. SYMBOL / SHAPE TYPE OF OPERATION /
C++ Code Example
Start
Add 1 to I or I = I +1
Total: A
Hardcopy - document output to a printer. The C++ coding required to print hardcopy varies with each compiler. Manual input from the keyboard to memory.
cin >> A;
Decision - based on a relational condition, select from (branch to) multiple processes.
if (A < 0) {statements;} else {statements;}
Randy Gibson
P. 1
Connectors: On-page (left) & Off-page (right). Used to either: 1. Continue a flowchart at a different place either on or off the same piece of paper. 2. Close a selection branch or loop.
Symbols can be drawn any size (height or width) necessary to hold the symbol's contents. The shapes of most symbols imply the process. It is redundant to put the word "print" in a hardcopy symbol for example. Always put an arrowhead on each line connecting symbols to indicate the "flow of control". Do not assume that is will always be down or to the right. In output symbols, always differentiate between literal characters and identifiers by placing a box around the identifiers. For example in hardcopy output of variables named DOLLARS and CENTS mixed with some descriptive literal text, be sure to box the variable labels, like:
Also note the inclusion of the symbol in the example above to indicate the use of a carriage return. It is also common to use the notation "<CR>" to represent a carriage return. The only symbols that may receive more than one incoming arrow are connectors. Never enter any other symbols using more than one arrow. If you want to do that, put a connector in front of the symbol and let the multiple arrows enter the connector. Don't do this: Do this:
Randy Gibson
P. 2
The switch statement involves a special use of the diamond symbol. A flowchart for the following switch statement is shown to its right.
switch (ANS) { case 'Y': case 'y': X = 1; break; case 'N': case 'n': X =-1; break; default: X = 0; break; }
Notice that the diamond contains only the name of the single variable to be evaluated. The "legs" that exit the decision diamond are each labeled with the unique values from a limited set of possible values for the variable ANS, including the "else" (default) option.
PATH: Faculty.IRSC.Edu> Computer Science> Faculty> Randy Gibson> Instructional Server> COP 2000> Examples>
Randy Gibson
P. 3