Decision Table
Decision Table
Decision Table
A decision table is a table which may accompany a flowchart, defining the possible contingencies that may be
considered within the program and the appropriate course of action for each contingency. Decision tables are
necessitated by the fact that branches of the flowchart multiply at each diamond (comparison symbol) and
may easily run into scores and even hundreds. If, therefore, the programmer attempts to draw a flowchart
directly, he is liable to miss some of the branches.
A decision table is divided into four parts:
(1) Condition Stub· (which comprehensively lists the comparisons or conditions);
(2) Action Stub which comprehensively lists the actions to be taken along the various program branches;
(3) Condition entries which list in its various columns the possible permutations of answer to the questions in
the conditions stub);
(4) Action entries (which lists, in its columns corresponding to the condition entries the actions contingent
upon the set of answers to questions of that column)
A decision table is given below as an example -
There are two conditions: C1 and C2 In this table and two actions: Al and A2- According to R1 (a set of rules), if
there is a "Yes" to C1 and C2 is to be bypassed, action Al will be taken, that is, "Allow credit facility". Under R3,
No to both C1 and C2 requires action A2 to be taken. With this example, we give below the components of the
decision table in more detail.
1. Condition Statement - Statement which introduce- one or more conditions. (i.e., factors to consider in
making a decision).
2. Condition Entries - Entries that complete condition statements.
3. Action Statements· Statements which introduce one or more actions (i.e., steps to be taken when a certain
combination of conditions exist).
4. Action Entries - Entries that complete the action statements.
S. Rules - Unique combinations of conditions and actions to be taken under those conditions.
6. Header - Title identifying the table.
7. Rule Identifiers - Code (Rl, R2, RS,) uniquely identifying each rule within a table.
8. Condition Identifiers - Codes (Cl, C2, CS, ) uniquely identifying each condition statements/entry.
9. Action Identifiers. Codes (Al, A2, & AS ) uniquely identifying each action statement / entry .These items are
contained within the body of the table which is divided into four major sections by a bold vertical and
horizontal lines as in the table above.
TYPES OF DECISION TABLES
Limited Entry Tables - In a limited entry table the condition and action statements are complete. The condition
and action entries merely define whether or not a condition exists or an action should be taken. The symbols
used in the condition entries are:
Y: Yes, the condition exists
N: No, the condition does not exist.
- : Irrelevant, the condition does not apply, or it (or blank) makes no difference whether the condition exists or
not.
The symbols used in the action entries are:
X : Execute the action specified by the (or blank) action statement.
- : Do not execute the action specified by the (or blank) action statement.
Extended Entry Table: The condition and action statements in an extended entry table are not complete, but
are
completed by the condition and action entries.
Mixed Entry Table: The third type of decision table is the mixed entry form which combines both the limited
and extended entry forms. While the limited and extended entry forms can be mixed within a table, only one
form may be used within a condition statement/entry or an action statement / entry.
Question 3
Company X sells merchandise to wholesale and retail outlets. Wholesale customers receive a two percent
discount on all orders. The company also encourages both wholesale and retail customers to pay cash on
delivery by offering a two percent discount for this method of payment. Another two percent discount is
given on orders of 50 or more units. Each column represents a certain type of order.
Question 4
Check acceptance policy
Create a decision table for a check acceptance policy. The conditions are:
• Check amount is less than $100
• Customer has a driver's license
• Customer has a check guarantee card
• Check is a two-party check
• Customer is a "preferred customer"
The check can be accepted if:
• Customer has a check guarantee card and a driver's license
• Check is less than $100 and the customer shows a driver's license or a check guarantee card
• Customer is a "preferred customer" and check amount is less than $100
• Customer is a "preferred customer" and check is a two-party check
Question 5
A hire-purchases scheme has adopted the following criterion for its customers. The customers will get the
credit facility if they satisfy any of the following conditions:
(i) The customer must hold the present job for more than 5 years and reside in the same place at least for 3
years. In this case, the customer will get credit upto rupees three thousand.
(ii) The monthly salary of the customer must exceed rupees two thousand and must hold the present job for
more than 5 years. In this case credit will be given upto rupees four thousand.
(iii) The monthly salary must exceed rupees two thousand and reside at the same place at least for 3 years. In
this case credit will be given upto rupees four thousand.
(iv) In the case, the customer's monthly salary exceeds rupees two thousand, holds the present job for more
than 5 years and also reside in the same place at least for the 3 years, the credit facility will be upto rupees five
thousand. The credit facility is rejected for all other customers. Prepare a decision table for this hire purchase
scheme.
Question 6
A computer file has customer name, type, bill number, bill date, amount and the date of payment. If the
customer is a dealer and pays his bills within 30 days, 10% discount is allowed. If it is 30 to 45 days, discount
and surcharge is zero. If he pays after 45 days, he has to pay 10% surcharge. The corresponding percentages
for a manufacturer are 12%, 0, 12 Yz %. Write a decision table for the above problem.
Question 7
A sales organisation is seeking to hire some salesmen and sales-women having special characteristics. They
need only unmarried personnel between the age of 18 and 30. If male, they want the salesman to be over
5Y2ft in height but less than 75 Kg. in weight and not bald. If female, the saleswoman is to be less than 5Y2ft.
in height and less than 55 kg. in weight and is to have shoulder-length hair.
Answer 5:- This problem has nine conditions, which would mean a table with 29 = 522 rules before reduction.
But the
problem fits logically into three parts: the overall criteria, male criteria, and female criteria. This suggests that
three
decision tables should be used-initial screening, male selection and female section. The result of this use of
three tables is shown below. All tables have redundancies removed.
Question 8.