Assignment: Unstructured Specification In I.S.

 

Given the following CUSTOMER file,

Name

Balance

Credit-Limit

Jones

Smith

Lopez

Black

900

800

1,500

1,700

18,000

21,000

19,000

25,000

consider the following unstructured process specification:

For each customer in the CUSTOMER file whose balance exceeds $1,000, print name and balance. However, if credit-limit exceeds $20,000, print name, balance and credit-limit.

This specification contains an ambiguity, which gives rise to multiple interpretations of its meaning. Below, you will find two different ways of structuring (i.e. interpreting) the above ambiguous specification. For each version, execute it and write down (under “Result”) what the actual result would look like.

 

 

 

 

Structured English

 

Result

1

 

 

FOR EACH record in tbl-customer

IF balance > 1,000 THEN

Print name, balance

ENDIF

IF credit-limit > 20,000 THEN

Print name, balance, credit-limit

ENDIF

ENDFOR

Name Balance  Credit-Limit 

 

 

 

 

 2

 

 

FOR EACH record in tbl-customer

IF balance > 1,000 THEN

Print name, balance

ELSE

IF credit-limit > 20,000 THEN

Print name, balance, credit-limit

ENDIF

ENDIF

ENDFOR

Name Balance  Credit-Limit