Sei sulla pagina 1di 3

AS Computing – Problem Solving with Decision Tables

Steps to make a decision table

1. Draw boxes for the top and bottom left quadrants.

2. List the conditions in the top, left quadrant. When possible, phrase the conditions as questions that
can be answered with Yes or No. (You may need to figure these out first).

3. List the possible actions in the bottom, left quadrant. (You may need to figure these out first).

4. Each condition can have Y or N values (so, 2 in total). Multiple the number of conditions by the
number of possible values (2). Draw one column through the top and bottom right quadrants for
each combination.

For example, if there are three conditions then it would be 3*2 = 6 possible columns.

5. Enter all possible combinations of values in the columns in the top, right quadrant of the table.

6. For each column (each unique combination of conditions), mark an X in the bottom, right quadrant
in the appropriate action row

Exercise 1

No charges are reimbursed to the patient until the deductible has been met. After the deductible has been
met, reimburse 50% for Doctor's Office visits (D) or 80% for Hospital visits (H).

There will be 4 rules. The first condition (Is the deductible met?) has two possible outcomes, yes or no. The
second condition (type of visit) has two possible outcomes, Doctor's office visit (D) or Hospital visit (H). Two
times two is four.

Conditions 1 2 3 4

1. Deductible met?

2. Type of visit

Actions

1. Reimburse 50%

2. Reimburse 80%

3. No reimbursement
Exercise 2

If Test Score is greater than 50 AND Absence Rate is less than 20


Then Output “Pass”
Else Output “Fail”

Construct a decision table based on the above logic.

Exercise 3

If X is greater than 6 and Y is less than 7 or Z is equal to 3


Then output “Pass”
Else output “Fail”

HINT: 3 conditions, each can accept Y or N – 2 values (2*2*2)


Exercise 4

Books2U Mail Order Book Club

Members of the book club whose orders exceed £100 a year and have a good payment record are given
priority treatment. Where a membership has been over 10 years, the member will get priority treatment if
the orders exceed £100 a year, in which case the club is prepared to overlook a poor payment record. If the
orders placed by a member of more than 10 years’ standing do not exceed £100 during the year, but the
member has a good payment record, then priority treatment is also given. In all other circumstances, the
order is given normal treatment.

Draw a limited entry decision table.

Potrebbero piacerti anche