Decision Table\

advertisement
Decision Table
Section A
1. The Personnel Department of XYZ Hospital has adopted a
scheme of promotions for its assistant nurses (AN) and staff
nurses (SN). It is based on the following rules:
R1 - If an AN has > 5 years working experience, they should
be promoted to senior AN
R2- If an AN has >5 years working experience and has
completed an SN course, they should be promoted to SN
R3- If an AN has completed an SN course, has >5 years
working experience and has good management skill, they
should be promoted to senior SN
R4- If an AN has completed an SN course and has good
management skill, they should be promoted to SN
Copy the decision table below to your answer booklet and
complete it, based on the information given. [Note: Make sure
you use the correct notation] [4]
R1 R2 R3 R4
>5 years working experience
Completed SN course
Management skill
Senior SN
SN
Senior AN
[4]
Section B
1.
A civil service computer centre receives so many job applications
that it uses the following rules to decide what to do with each
candidate:
If the candidate has a Diploma in Computer Studies, knowledge of
hardware and experience in software development, then assign to
the Systems Group.
If the candidate has a Diploma in Computer Studies and experience
in software development, then assign to the Programming Group.
If the candidate has a Diploma in Computer Studies and knowledge
of hardware, then assign to the Operations Group.
If the candidate has knowledge of hardware and experience in
software development, then assign to the Operations Group.
Otherwise, interview the candidate.
(a) Draw a limited entry decision table for these rules.
[1
2]
(b) Translate your decision table into pseudocode.
[8]
(c) State how many rules a decision table would have if there were: [2]
(i) 4 conditions
(ii) 5 conditions
(d) Briefly describe the advantages of using decision tables.
2. i)
[8]
Give short descriptions of the following types of decision table :
Limited entry decision table [2]
Extended entry decision table [3]
Mixed entry decision table [2]
ii)
Write brief notes to explain the purpose of a decision table preprocessor.
[3]
3.
Convert the following pseudocode into a limited-entry decision table.
IF age > 40 THEN
IF high blood pressure THEN
IF diabetic THEN
DO
regular check up
insulin injection
medication
ENDDO
ELSE
medication
dietary advice
ENDIF
ELSE
IF diabetic THEN
DO
dietary advice
insulin injection
ENDDO
ELSE
DO
dietary advice
ENDDO
ENDIF
ENDIF
ELSE
IF high blood pressure THEN
IF diabetic THEN
DO
medication
insulin injection
ENDDO
ELSE
DO
medication
dietary advice
ENDDO
ENDIF
ELSE
IF diabetic THEN
DO
insulin injection
ENDDO
ELSE
DO
dietary advice
ENDDO
ENDIF
ENDIF
ENDIF
[15]
4)
A software company is selling the latest version of their best-selling
package at various different prices.
The selling price is decided on whether the customer is an
authorized dealer and the number of copies they purchase. The
Decision Table below summarises the different charges.
Authorized Dealer
QUANTITY > 20
QUANTITY > 10
QUANTITY > 0
UNIT-PRICE = 180
UNIT-PRICE = 200
DISCOUNT = 15%
DISCOUNT = 5%
DELIVERYCHARGE = 100
DELIVERYCHARGE = 50
Check Purchase
Order
R13
R14
R15
R16
N
Y
N
N
-
N
N
Y
Y
X
X
N
N
Y
N
-
N
N
N
Y
X
-
N
N
N
N
-
-
-
X
-
X
-
-
-
-
-
-
-
-
X
X
X
-
X
-
X
R1
R2
R3
R4
R5
R6
R7
R8
R9
R10
R11 R12
Y
Y
Y
Y
X
X
-
Y
Y
Y
N
-
Y
Y
N
Y
-
Y
Y
N
N
-
Y
N
Y
Y
X
X
-
Y
N
Y
N
-
Y
N
N
Y
X
X
Y
N
N
N
-
N
Y
Y
Y
X
X
N
Y
Y
N
-
N
Y
N
Y
-
-
-
-
-
-
-
X
-
-
-
X
-
-
-
X
-
-
-
X
-
X
X
X
-
X
-
X
-
The charge is calculated as follows:
CHARGE =
( (unit-price * quantity) + delivery-charge) - discount
Calculate the charges arising from the following different purchases:
(i)
Customer type = Authorized Dealer, Quantity 60.
(ii)
Customer type = Authorized Dealer, Quantity 15.
(iii)
Customer type = Authorized Dealer, Quantity 5.
(iv)
Customer type = Not an Authorized Dealer, Quantity 60.
(v)
Customer type = Not an Authorized Dealer, Quantity 15.
(vi)
Customer type = Not an Authorized Dealer, Quantity 5.
[6]
Download