Sunteți pe pagina 1din 1

Decision Tables

Decision Tables are a graphic method for describing the logic of decisions. IN a tabular format, the decision
table lists a set of conditions plus a set of actions and identifies different combinations of decision which
lead to different combinations of actions. These Different combinations are termed rules.

A decision table is simply a table showing the various actions to be taken for different combinations of
conditions. Since it specifies only the logic rules involved, and says nothing about the procedure used, a
decision table is more problem oriented than a flow chart (which is solution oriented). The decision tables
are more useful than flowcharts as an aid to program design.

Decision tables are a precise yet compact way to model complicated logic. Decision tables, like if-then-else
and switch-case statements, associate conditions with actions to perform. But, unlike the control structures
found in traditional programming languages, decision tables can associate many independent conditions
with several actions in an elegant way

Decision tables are typically divided into four quadrants, as shown below.

The four quadrants


Heading Rule Numbers
Condition alternatives
Condition Stub
(Condition Entries)
Action Stub Action entries

The Condition stub describes the conditions that could exist in the program logic. Thus, the contents of
condition stub correspond to the conditions contained in the decision symbols of flowchart.

Action stub contains the actions statements. These statements correspond to the statements located in non-
decision symbols of flowchart. While the condition statements reveal the possible states of the input data,
the action statements describe the possible actions of the computer system.

The steps to be followed for constructing a decision table are as follows:


1. Properly define the problem that has to be solved by computer.
2. List out all the conditions to be tested in the problem.
3. List out the corresponding actions that should be taken with each combination of conditions.
4. Form a decision table using the two lists.

Advantage
Decision tables are normally used in place of flowcharts because of the following reason:
1. They provide concise descriptions of logically complex situations.
2. They are easier to draw and change than flowcharts.
3. They provide more compact documentation. A small table can replace several pages of flowcharts.
4. It is also easier to follow a particular path down one column than through several flowcharts pages.

Limitations:
1. Large decision tables can become incomprehensible and difficult to modify.
2. Flowcharts are better able to express the total sequence of events needed to solve a problem.
3. Flowcharts are more familiar to, and are preferred by, many programmers and beginners.

S-ar putea să vă placă și