Flowchart

来源:互联网 发布:知学学院宋剑勇 编辑:程序博客网 时间:2024/05/20 15:12

keyworks:
program flowchart 程序流程图
module 模块
macrochart 宏流程图
microchart 微流程图
programming control structure 程序控制结构
sequence structure 顺序结构
selection structure 选择结构
loop structure 循环结构
chart 图
maincontrol 主控图
symbol 符号
American national standards instituate 美国国家标准学会
input/output 输入/输出
processing 处理
data movement instruction 数据传输指令
terminal 终端
interruption point 终端店
program branch 程序分支
decision 判定
entry 入口
logic/compassion 逻辑/比较
conditional statement 条件语句
conector 连接符,连接器

A program flowchart is a detailed graph that represents steps to be performed within the machine to produce the needed output, As fig 7-1 shows, the program flowchart evolves the system chart.

1.Level of program Flowcharts
There are no set standards on the amount of detail that should be provided in a program chart, The billing program outlined in fig 7-1 and fig, 7-1 could esily have been shown in a single chart, but as you have seen, it’s often desirable in more complex situtations to break major program segments or modules into still smaller and more manageable units, Fig 7-1 illustrates how a smaller chart can evolve from a higher-level chart, A chart that outline the main segments of a program is called a maincontrol, modular,or macrochart, One that details the steps in module is called a microchart.

2.Sysbols Used in program flowcharts
Only a few symbols are needed in program charting to indicate the necessary operations, these symbols, which have been adopted by the American Natioanl Standards institute, are shown here and their descriptions follow,

1) input/output

In the program flowchart section of fig 7-1, the I/O symbol designates:
.the input data to be read into the cpu
.the output information to be printed on the customer’s bill

2)processing
The rectagle used in system charts in agin used in program charts to represent processing operations. Arithmetic and data movement instructions are generally placed in these boxes. A processing symbol is shown in the microchart in fig 7-1, the amount of a customer’s bill is computed bu multiplying the quantity of a product purchased by the unit price of the product.

3)Terminal
The terminal symbol, as the name suggests, represents the beginning and the end of a program. it may also be used to signal a program interruption point when information may enter or leave. for example. to detect certain errors in input data, the programmer may provide a special program branch ending in a terminal symbol labeled “html”

4) Decision

The I/o processing symbols have two flow lines, while the terminal has a single entry or exit line, The diamond shaped decision symbol. on the other hand. has one entrance and at least two exit paths or branches, this symbol indicates logic/comparision deternined by a yes or no answer to some conditioanal statement written in the form of a question, in fig 7-1, the condition to be determined is whether or not the last customer record has been processed.

5)Connector
A circular connector symbol labeled “1” is encountered in fig 7-1 when program control exits from the decision sysmbol along the “no” branch. This connector symbol is used when additional flow line might cause confusion and reduce understanding, two connectors with identical labels serve the same function as long flow line, that is. they show an exit to some other chart section, or thet indicate an entry from another part of the chart.

3.programming control structures
These three control structures are illustrated in fig 7-2

1)sequence structure

In the sequence structure , the processing steps are performed in sequence, one after another.

2)selection structure

The selection structure depicts the logic for selecting the appropriate sequence of statements, in the selection structure, a decision is made as to which sequence of instructions is to be executed next.

3)Loop structure

The Loop structure is used to represent the program logic when a portion of the program is to be executed repeatedly until a particular condition is met, There are two variations of the loop structure: when the decision, or test -on - condition, is placed at the begainning of the statement sequence, it becomes a dowhile loop; when placed at the end , it becomes a dountil loop.

原创粉丝点击