Objectives: Introduction Over View of System Analysis and Design



Download 0.94 Mb.
View original pdf
Page79/140
Date13.11.2023
Size0.94 Mb.
#62581
1   ...   75   76   77   78   79   80   81   82   ...   140
ms-04

6.4.5 DECISION TABLES
A major drawback of a decision tree is the lack of information in its format to tell us what other combinations of conditions to test. This is where the decision table is useful. A decision table is a table of contingencies for defining a problem and the actions to betaken. It is single representation of the relationships between conditions and actions.

A decision table consists of two part stub and entry. FIGURE Structured English- Using Data Dictionary Values.
COMPUTE-DISCOUNT Add up the number of copies per book title IF order is from bookstore And – IF ORDER SIZE is SMALL THEN Discount is 25% ELSE (ORDER SIZE is MINIMUM) So no discount is allowed ELSE (order is from libraries or individual customers)
So-IF ORDER SIZE is LARGE Discount is 15% ELSE IF OREDR SIZE is EMDIUM Discount is 10% ELSE IF ORDER-SIZE is SMALL Discount is 5% ELSE (ORDER SIZE is MINIMUM) So no discount is allowed The stub part is divided into an upper quadrant called the condition stub and a lower quadrant called the action stub. The entry part is also divided into an upper quadrant, called the condition entry and a lower quadrant called the action entry. The four elements and their definitions are summarized in Figure . FIGURE Decision Table- Discount Policy Condition Stub Condition Entry


----------------------------------------------
1 2
3 4
5 6

Customer is bookstore Orders i
z e co Y Y Y N N NY Y N NY NY N NY N NY N NY N N N


Action Stub Action Entry FIGURE Elements and Definitions in a Decision Table Elements Location Definition Conditions Stub Upper left quadrant Sets forth in question form the condition that may exist Action Stub Lower left quadrant Outlines in narrative form the action to Betaken to meet such conditon

Condition entry Upper right quadrant Provides answers to questions asked in The condition stub quadrant Action entry Lower right quadrant Indicates the appropriate action resulting Form the answers to the conditions in the Condition entry quadrant The answers are represented by a Y to signify yes, an N to signify no, or a blank to show that the condition involved has not been tested. In the action entry quadrant an Xor a check mark will do) indicates the response to the answers) entered in the condition entry quadrant. Furthermore, each column represents a decision or a rule. For example, rule 1 states IF customer is a bookstore and order size is 6 copies or more. THEN allow 25% discount So, according to the decision table, we have six decisions and therefore six rules. A look at the table provides each decision (answer) immediately the following rules should be followed in constructing decision tables
1. A decision should be given a name, shown in the top left of the table.
2. The logic of the decision table is independent of the sequence in which the condition rules are written, but the action takes place in the order in which the events occur.
3. Standardized language must be used consistently.
4. Duplication of terms or meanings should be eliminated, where possible.

Download 0.94 Mb.

Share with your friends:
1   ...   75   76   77   78   79   80   81   82   ...   140




The database is protected by copyright ©ininet.org 2024
send message

    Main page