WORKED EXAMPLES ON PROCESS SPECIFICATION.

PROCESS SPECIFICATION

WORKED EXAMPLES

6.1 A bank has the following policy on deposits: On deposits of Rs. 5000 and above and for three years or above the interest is 12%. On the same deposit for a period less than 3 years it is 10%. On deposits below Rs. 5000 the interest is 8% regardless of the period of deposit. Write the above process using

(i) Structured English

(ii) A decision table

image

6.2 An organization maintains an employee file in which each record has following data:

{ Employee No., employee name, employee gross pay}.

It has been decided to increase the pay as per the following formula:

For pay of Rs. 1000 or less increase 15%.

For pay of more than Rs. 1000 but up to Rs. 2500 increase 10%.

For pay over Rs. 2500 increase 5%.

(i) Write a structured English processing rule corresponding to the above policies.

(ii) Express the policies as a decision table.

(i)

While employee records left in file do Read Number, name , gross pay

image

6.3 An offshore gas company bills its customers according to the following rate schedule:

First 500 litres Rs. 10 (flat)

Next 300 litres Rs. 1.25 per 100 litres

Next 30,000 litres Rs. 1.20 per 100 litres

Next 100,000 litres Rs. 1.10 per 100 litres

Above this Re. 1.00 per 100 litres

The input record has customer identification, name and address, meter reading, past and present. Write a structured English procedure to obtain a bill for the customer.

While record left in customer file do

Read customer id, name, address, past meter reading, new meter reading Consumption = new meter reading – old meter reading

if consumption <= 500 then charge =10

else if consumption <=800

then charge = 10 + (consumption – 500) * 0.0125

else

if consumption <= 30800

then charge = 13.75

+(consumption – 800) * 0.012

else

if consumption <=130800

then charge = 373.75 + (consumption – 30800) * 0.011

else charge = 1473.75 + (consumption – 130800) * 0.01 end if

end if

end if

end if

write customer id, name, address, past meter reading, new meter reading, consumption, charge

end while

6.4 Refer to users requirements stated in exercise 6.4 of Question bank. Develop the processing rules in structured English for the stores process shown in Fig. 5.8.

image

image

6.5 Refer to Exercise 6.4 in Question Bank. Develop the processing rules in structured English for the purchase process of Fig. 5.9.

for each discrepancy note received from the receiving office do

{ intimate specified vendor enter discrepancy in the discrepancy file }

end for

for each goods rejected note received from the inspection office do

{ intimate specified vendor enter rejected items note in items rejected file }

end for

for each reorder advice or new requisition received for an item from stores do

{ Refer to item file to find vendor details and order qty. send order to specified vendor enter order in order file }

end for

6.6. State the processing rules in structured English for the various processes in the data flow diagram for the hostel DFD described in Module 5

Mess Process

for each absence note do Read student charge record from student charge file (using student number as key)

Add absence days to absence field

Write student charge record in student charge file

end for

for each extras note do

Read student charge record

Append extras code and quantity to record

Write student charge in student charge file

end for

Billing Process

While student charge records left in student charge file do

Read student charge record from student charge file

No. of days to charge = no. of days in a month – no. of days absent. Monthly charge = no. of days to charge * daily rate

Total extras charge = 0

for each extra item do

extras charge (code) = extra qty. * charge (code)

end for

Add extra charge to total extra charge

Amount to be billed = no. of days to charge * daily rate + total extras

charge

Student bill record = student charge record + daily rate, no. of days charged, monthly charge, extras charge (code) , total extras charge , grand total to pay

Write student bill record

end while

(Note: It is assumed that the daily rate, no. of days in a month and extras charge for each extras code is stored in the billing process as an internal data record.)

Payment Reconciliation Process

for each student Bill record do

Store student Bill record in Bill file

end for

for each payment received do

Read bill record of student from Bill file if amount paid = grand total to pay then balance due = 0

else balance due = (grand total to pay – amount paid)

Store bill record in unpaid bill file

end if end for

On payment due date, (due date + 10), (due date + 20) do While records left in unpaid Bill file do

if balance due > 0

then send overdue notice,

end if end while

On (payment due date + 30) do

While records left in unpaid bill file do if balance due > 0

then send message to warden

end if end while

6.7 The policy followed by a company to process customer orders is given by the following rules:

(i) If the customer order <= that in stock and his credit is OK, supply his requirement.

(ii) If the customer credit is not OK do not supply. Send him an intimation.

(iii) If the customer credit is OK but items in stock are less than his order, supply what is in stock. Enter balance to be sent in back-order file.

Obtain a decision table for above policy

image

Observe that the last rule is not specified in the statement of rules. This has been added to complete the table.

6.8 Obtain a decision table to decide whether on a given date an employee in an organization has completed one year’s service or not.

Let date of joining be DJ/MJ/YJ (Day/Month/Year)

Let today’s date be DT/MT/YT (Day/Month/Year)

image

6.9 Obtain a decision table corresponding to the structured English procedure given in worked example 6.4of decision table

for each customer requisition do decision table

image

6.10 Obtain a decision table for an automatic stamp vending machine with the following specifications:

(i) To dispense 20, 15, 10, 5 paise stamps

(ii) To accept 50, 25, 10, 5 paise coins

(iii) Do not return change if it is necessary to return more than two coins of the same denomination. In such a case return the customer’s coin and turn on “no change” light.

The machine should dispense a stamp, the right amount of change tendered, no stamp available, no change available, etc.

image

6.11 Obtain the decision table to be used by a person to enter the office of a manager.

The conditions to be checked are:

Door open? Ring sign on? Enter sign on? Door locked?

The actions a person takes are: Ring bell, enter, wait, leave.

After obtaining the decision table, ensure that it has no logical errors and that it is in minimal form.

image

6.12 In installment buying where payments are made on a weekly basis the action taken on “an account goes into arrears” is a crucial aspect of the operation. Table S6.12 illustrates a simplified arrears procedure. Answer the following questions:

(i) Are all elementary rules logically possible?

(ii) Is the table complete?

(iii) Has the table any ambiguities?

(iv) Are there logical errors in the table? If yes, point them out.

(v) Use reasonable assumptions and correct the table.

(vi) Remove any redundancies in the corrected table (Table S6.12).

image

image

If in all these cases we take action to notify accounts (Action A1) then the K- map becomes the one shown in Fig. S9.11

image

image

6.13 The policy followed by a company to process customer orders is given by the following rules:

(i) If the customer order that in stock and his credit is OK, supply his requirement.

(ii) If the customer credit is not OK do not supply. Send him an intimation.

(iii) If the customer credit is OK but items in stock are less than his order, supply what is in stock. Enter the balance to be sent in a back-order file.

Obtain a decision table for the above policy.

C1 : Customer order <= Item in the stock

C2 : Customer credit ok

image

6.14 Obtain a decision tree to be used by a person to enter the office of a manager. The conditions to be checked are:

Door open? Ring sign on? Enter sign on? Door locked? The actions a person takes are:

Ring bell, enter, wait, leave.

After obtaining the decision table, ensure that it has no logical errors and that it is in minimal form.

C1 : Door open

C2 : Ring sign on

C3 : Enter sign on

C4 : Door locked

image

Observe that C1 is not relevant and not clear in the Decision tree

6.15 A University has the following rules for a student to qualify for a degree with Physics as the main subject and Mathematics as the subsidiary subject:

(i) he should get 50% or more marks in Physics and 40% or more marks in Mathematics.

(ii) If he gets < 50% marks in Physics, he should get 50% or more marks in Mathematics. He should, however, get at least 40% marks in Physics.

(iii) If he gets < 40% marks in Mathematics and 60% or more marks in Physics, he is allowed to reappear in Mathematics examination only so that he can qualify.

Obtain a decision tree for the above problem

image

image

6.16 You want to go to Delhi from Bangalore. There are three flights per day; early morning, late morning and evening. You would like to go on 21.4.04 by early morning flight. If it is not available you will take the late morning flight or evening flight in that order. If neither is available you are willing to take any flight on 22.4.04 but prefer early and late morning flights., Obtain a decision tree for this word statement. Is decision table suitable for this problem? If not why?

image

C1 : Is ticket available on early morning flight on 21/4/04

C2 : Is ticket available on late morning flight on 21/4/04

C3 : Is ticket available on evening flight on 21/4/04

C4 : Is ticket available on early morning flight on 22/4/04

C5 : Is ticket available on late morning flight on 22/4/04

C6 : Is ticket available on evening flight on 22/4/04

Comments

Popular posts from this blog

Why do we need information systems, management structure, requirements of information at different levels of management.

The User Interface:Establishing User Interfaces