Decision Table

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

Class 6 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.

STEPS IN PREPARING A LIMITED ENTRY DECISION TABLE


1. List conditions and actions.
2. Combine conditions which describe the only two possibilities of a single condition. In other words, delete
conditions which can be derived from the responses of the other conditions ..
3. Make yes or no (Y or N) responses and mark actions to be taken for each rule with X.
4. Combine redundant rules to simplify table.
5. Check for completeness.
ADVANTAGES AND DISADVANTAGES OF DECISION TABLES
1. A decision table has a number of advantages which are stated below:
2. A decision table provides a framework for a complete and accurate statement of processing or decision
logic. It
forces a discipline on the programmer to think through all possible conditions.
3. A decision table may be easier to construct than a flow chart.
4. A decision table is compact and easily understood making it very' effective for communication between
analysts or
programmers and non-technical users. Better documentation is provided by it.
5. Direct conversion of decision table into a computer program is possible. Software packages are
available which
take the statement specifying a decision table and compile it into a program.
6. It is possible to check that all test combinations have been considered.
7. Alternatives are shown side by side to facilitate analysis of combinations.
8. The tables show cause and effect relationships.
9. They use standardized format.
10. Typists can copy tables with virtually no question or problems.
11. Complex tables can easily be split into simpler tables.
12. Table users are not required to possess Computer knowledge.
DISADVANTAGES OF USING DECISION TABLES ARE AS FOLLOWS:
1. Total sequence - The total sequence is not clearly shown i.e., no overall picture is given by decision
tables as
presented by flow charts.
2. Logic - Where the logic of a system is simple, flowcharts nearly always serve the purpose better than a
decision
table.
PRACTICE EXERCISES
Question 1
The details of procedure for dealing with delivery charges for goods bought ,from ABC Company is given: For
calculating the delivery charges, customers are divided into two categories, those whose sales region code is
10 or above and those with the code of less than 10. If the code is less than 10 and the invoice amount is less
than Rs. 10,000, the delivery charge to be added to the .invoice total is Rs. 200. But if the invoice value is for
Rs. 10,000 or more, the delivery charge is Rs. 100. If the code is equal to or greater than 10, the corresponding
delivery charges are Rs. 250 and Rs. 150 respectively.
i. Prepare a decision table of the above procedure
ii. Prepare a program flowchart segment of the above procedure.
Question 2
While invoicing each customer, the invoice clerk has to work out the discounts allowable on each order. Any
order over Rs. 20,000 attracts a "bulk" discount of 8%. A customer within the trade is allowed 10%. There is
also a special discount of 5% allowed for any customer who has been ordering regularly for over 5 years.
Draw A decision table; to illustrate the clerical procedure for working. out this management policy.

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.

You might also like