DECISION TABLE Question 1 A wholeseller has three commodities to sell and has three types of customers. The discount is given as per following rules: (i) For Govt. orders, 15% discount is given irrespective of the value of the order. (ii) For orders of more than Rs.20,000, an agent gets a discount of 20% and the retailer 15% respectively. (iii) For orders of value between Rs.10,000 and Rs.20,000, agent gets discount of 15% and the retailer gets 10%. (iv) For order of value less than Rs.10,000 the agent and retailer get discount 10% and 5% respectively. The above rules do not apply to furniture items. However, in case of furniture items, a flat rate of 10% discount is admissible to all type of customers. Prepare a limited entry decision table. (PE – II Nov. 2002) Answer Limited Entry Decision Table Conditions Rule Number 1 2 3 4 5 6 7 8 Order : < 10,000 - N N N N Y Y - 10,000 and < 20,000 - N N Y Y N N - > 20,000 - Y Y N N N N - Customer: Govt. Y N N N N N N - Agent N Y N Y N Y N - Retailer N N Y N Y N Y - N N N N N N N Y Product : Furniture 15.2 Decision Table Action Discount of 5% X 10% 15% 20% X X X X X X X Alternative solutions exist. Question 2 Explain "Decision table". Explain in brief four parts of a decision table. (PE-II, Nov 2005) Answer 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: (i) Condition stub: It contains statements i.e., the factors to be considered in making a decision. (ii) Action stub: It introduces one or more actions i.e., steps to be taken when a certain combination of conditions exists. (iii) Condition entries: It lists in its various columns the possible permutations of answers to the questions in the condition stub. (iv) Action entries: It lists in its columns corresponding to the condition entries, the actions contingent upon the set of answers to the questions in that column. Question 3 Explain the advantages of decision tables. (PE-II, May 2006) Answer Advantages of Decision tables (i) 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. (ii) A decision table may be easier to construct than a flow chart. (iii) 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. Decision Table 15.3 (iv) Direct conversion of decision table into computer program is possible. (v) It is possible to check that all test combinations have been considered. (vi) Alternatives are shown side by side to facilitate analysis of combinations. (vii) The tables show cause and effect relationships. (viii) They use standardized format. (ix) Complex tables can easily be split into simpler tables. (x) Table users are not required to possess computer knowledge. Question 4 Explain the various types of decision tables. (PE-II, Nov 2006) Answer There are three types of decision tables as discussed below: (i) Limited Entry Tables: In this type of decision 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 makes no difference whether the condition exists or not. The symbols used in the action entries are: (ii) X : Execute the action specified by the action statement. : Do not execute the action specified by the 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. (iii) Mixed Entry Table: It 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.