Decision Table - Exercise

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 24

CSEB223

System Analysis and Design


Decision Table
Case Scenario (Decision Table)
The operation manager of Qantas Airline (QAL) thinks that there must be certain rules conflicting
with each other. He wants to study the current policy but he finds it hardly possible because the
document that records the policy has become a very long one with regulations and rules listing in
a mess. Let’s take a look at the document:
1. Infant passengers under two years old are offered a discount of 80% on domestic flights
2. Infant passengers under two years old are offered a discount of 70% on international flights.
3. Youth passengers (between two and sixteen) are offered a discount of 10%, for any kind of
destination.
4. Frequent flyer enjoys a discount of 20%.
5. For international flights, passengers are offered 15% discount if they travel during off-
seasons.
6. There would be no discount for international flights, except that when the passenger is an
infant passenger or when travelling during off-season.
7. Passengers who make reservation five months before their journey are offered a discount of
10%.
8. Frequent flyer enjoys a discount a 15% by making reservation five months before their
journey.
9. The amount of discount is accumulated.
10. The maximum amount of discount for infant passengers is 80%\The maximum amount of
discount for non-infant passengers is 20%
In order to find out the problem policy, he
decided to represent the rules in the form of a
decision table (1st Version). Refer below.
• Result of the 1st version?
• By studying the fifth and the sixth rule, he
discovered that frequent flyer who made an
early reservation will receive a 15% discount
while frequent flyer who made late reservation
will receive 5% more, which does not make sense
at all. So he managed to refine the policy, review
the change he made by comparing the rules and
finally updated the information system for this
change.
• Refer the next table (Decision Table version 1)
Decision Table (1st version)
Next, SIMPLFY the table
Decision Table (edited version)
Simplified table (Final Version)
Condition R1 R2 R3 R4 R5
C1: Infant passengers (age<2) Y Y
C2: Youth passengers (age: 2 – 16) Y Y
C3: Frequent Flyers Y Y
C4: Domestic Flights Y
C5: International Flights Y Y
C6: Early Reservation Y Y
C7: Off-season travelling Y
Action
A1: Offer 10% discount X
A2: Offer 15% discounts X
A3: Offer 20% discounts X
A4: Offer 70% discounts X
A5: Offer 80% discounts X
Create a decision table
• Three conditions;
– Order value between ₤0 and ₤10
– Order value between ₤11 and ₤100
– Customer with satisfactory credit limit
• Four actions;
– Approve order
– Allow discount 3%
– Allow discount 5%
– Refer to supervisor
Complete the decision table
• Action rules
– If order is between 0-10, approve the order
– If order more than 0-10 with satisfactory credit
limit, approve the order and apply discount 3%
– If order more than 0-10 without satisfactory credit
limit, refer to supervisor
– if order is more than 100, with satisfactory credit
limit, approve order and apply discount 5%
– If order more than 100, without satisfactory credit
limit, refer to supervisor
Answer

Can we simplify this table?

N
Simplified Decision Table

N
N -

N N
Prepare a decision table as given statements
below
• Condition:
– C1: Youth customer (age <18)
– C2: Customer is member
– C3: Transaction > $1000
• Action
– A1: Offer Discount 20%
– A2: Offer discount 5%
– A3: Offer discount 15%
– A4: Offer membership
Prepare the decision table
• If registered customer is below 18, with transaction of more
than $1000; customer deserves 15% discount.
• However, if customer has less than $1000, age below 18, not
yet registered; customer deserves only 5% and offer
membership
• If registered customer is 18 or older, with transaction of
more than $1000; offer 20% discount
• If new customer is 18 or older, with transaction of more than
$1000; offer membership and 15% discount
• If new customer aged older than 18 and has less than $1000;
offer only membership
Simplify table?
Conditions and Rules 1 2 3 4 5
C1: Youth customer (age <18) Y Y N N N
C2: Customer is member Y N Y N N
C3: Transaction > $1000 Y N Y Y N
Actions
A1: Offer Discount 20% X
A2: Offer discount 5% X
A3: Offer discount 15% X X

A4: Offer membership X X X


Simplify the table below.

Conditions/Rules R1 R2 R3 R4 R5 R6 R7 R8
C1:Under RM500 Y Y Y Y N N N N
C2:Pay by cash Y N Y N Y N Y N
C3:Pay by Credit Card N Y N Y N Y N Y
C4:Unknown Customer Y Y N N Y Y N N
Actions:
Pay at counter/cashier X X X X
Check credit card legitimate X X X X
Call supervisor X X
Update Database X X X X
Conditions/Rules R1 R2 R3 R4 R5 R6
C1:Under RM500 - - Y Y N N
C2:Pay by cash Y Y N N N N
C3:Pay by Credit Card N N Y Y Y Y
C4:Unknown Customer Y N Y N Y N
Actions
Pay at counter/cashier X X
Check credit card legitimate X X X X
Call supervisor X X
Update Database X X X

Simplified version of the previous table.


From 8 rules, it has been simplified to only 6 rules
Use the decision table below to answer the following questions:
How much is delivery if a preferred customer paid cash for a $99.95 bill? Charge $5
How much is delivery if a customer paid cash for a bill totaling $250.00, if they are not a
preferred customer? Charge $5
How much is delivery if the customer's bill comes out to $455.00, they paid by credit card,
and they're a preferred customer? Free Delivery
How much is delivery if a customer paid by credit card for a bill totaling $1005.49? Free Delivery
Rules
Delivery Charges
1 2 3 4 5 6

<500 & <500 & <500 &


Purchase Amount >=$500 >100 >100 >100 <=100 <=100

Preferred
Customer? -- Y N N -- --

Paid Cash? -- -- Y N Y N

Free Delivery X X        

Charge $5     X   X  

Charge $10       X   X
Prepare decision table
Define a decision table for admission to the
master program:
• Accepted if Bachelor in Information system
• Accepted with Pre-master if Bachelor in
Business Administration or Computer Science
• Rejected if with No Bachelor degree
• Tuition Fee of RM7000 if Malaysians
• Tuition Fee of RM10500 if Non-Malaysian
Answer
Condition Stubs R R R R R R
1 2 3 4 5 6
C1 – graduated with Bachelor in Information System Y N Y N N N
C2 – graduated with Business Administration or Computer N Y N Y N N
Science
C3 – Malaysians Y Y N N Y N
C4 – Non-Malaysians N N Y Y N Y
Action Stubs
A1 – Rejected X X
A2 – Accepted X X
A3 – Accepted (with Pre-Master) X X
A4 – Tuition Fee is RM7500 X X
A5 – Tuition Fee is RM10500 X X
Answer (Simplified Table)
Condition Stubs R R R R R
1 2 3 4 5
C1 – graduated with Bachelor in Information System Y N Y N N
C2 – graduated with Business Administration or Computer N Y N Y N
Science
C3 – Malaysians Y Y N N -
C4 – Non-Malaysians N N Y Y -
Action Stubs
A1 – Rejected X
A2 – Accepted X X
A3 –Accepted (with Pre-Master) X X
A4 – Tuition Fee is RM7500 X X
A5 – Tuition Fee is RM10500 X X
Option 2
Condition Stubs R R R R R R
1 2 3 4 5 6
C1 – graduated with Bachelor in Information System Y N N Y N N
C2 – graduated with Business Administration or Computer N Y N N Y N
Science
C3 – Malaysians Y Y Y N N N

Action Stubs
A1 – Rejected X X
A2 – Accepted X X
A3 – Accepted (with Pre-Master) X X
A4 – Tuition Fee is RM7500 X X
A5 – Tuition Fee is RM10500 X X
Answer 2 (Simplified Table)
Condition Stubs R R R R R
1 2 3 4 5
C1 – graduated with Bachelor in Information System Y N Y N N
C2 – graduated with Business Administration or Computer N Y N Y N
Science
C3 – Malaysians Y Y N N -

Action Stubs
A1 – Rejected X
A2 – Accepted X X
A3 – Accepted (with Pre-Master) X X
A4 – Tuition Fee is RM7500 X X
A5 – Tuition Fee is RM10500 X X
Option 3
Condition Stubs R R R R R R R R
1 2 3 4 5 6 7 8
C1 – graduated with Bachelor in Information System Y N N Y N N N N
C2 – graduated with Business Administration N Y N N Y N N N
C3 – graduated with Computer Science N N Y N N Y N N
C4 – Malaysians Y Y Y N N N Y N
C5 – Non-Malaysians N N N Y Y Y N Y
Action Stubs
A1 – Rejected X X
A2 – Accepted X X
A3 – Accepted (with Pre-Master) X X X X
A4 – Tuition Fee is RM7500 X X X
A5 – Tuition Fee is RM10500 X X X
Answer 3 (Simplified Table)
Condition Stubs R R R R R If you
1 2 3 4 5 noticed, no
C1 – graduated with Bachelor in Information System Y N Y N N matter if
the
C2 – graduated with Business Administration N - N - N
conditions
C3 – graduated with Computer Science N - N - N and
C4 – Malaysians Y Y N N - actions are
different,
C5 – Non-Malaysians N N Y Y -
but the
Action Stubs rules after
A1 – Rejected X simplified
A2 – Accepted X X will
ALWAYS be
A3 – Accepted (with Pre-Master) X X the same
A4 – Tuition Fee is RM7500 X X in total.
A5 – Tuition Fee is RM10500 X X (*with the
same
number of
actions)

You might also like