December 1998
SW204: SOFTWARE AND FILES DESIGN

QUESTION 4

Total Marks: 20 Marks

Click here to access other questions

SUGGESTED SOLUTIONS
Solutions and allocated marks are indicated in green.
Return to Question 4

4. (a) List three factors which you would take into account when choosing a type of the organisation. [3]

One mark should be awarded for each valid point (up to a maximum of three marks). Examples include the following:

  • The required reference facility.
  • Access type.
  • Hit rate.
  • Size.
  • Life expectancy.
  • Net growth rate.
  • Volatility.
  • Run integration.
  • Data integrity and backup.

Other sensible answers should also receive credit.

 

(b) For each of the following types of file organisation list two advantages:
(i) Sequential [2]

One mark should be awarded for each valid point (up to a maximum of two marks). Examples include the following:

  • File design is simple.
  • Efficient for high activity files.
  • Effective use of low cost file media.
  • Suitable for batch transactions.

Other sensible answers should also receive credit.

 

(ii) Indexed sequential [2]

One mark should be awarded for each valid point (up to a maximum of two marks). Examples include the following:

  • Transactions may be sorted or unsorted.
  • Only the affected master records are processed during updating.
  • Response time is reasonably fast.
  • File enquiries are facilitated.
  • Files can be processed sequentially and randomly.

Other sensible answers should also receive credit.

 

(iii) Random [2]

One mark should be awarded for each valid point (up to a maximum of two marks). Examples include the following:

  • Fast access for low hit-rate processing.
  • Handles volatile files easily.
  • Does not need room for indexes.
  • May be created over a long period of time.
  • Generate a manageable address from an unmanageable key.

Other sensible answers should also receive credit.

 

(c) For each of the following types of file organisation list one disadvantage:
(i) Sequential [1]

One mark should be awarded for a valid point. Examples include the following:

  • The entire file must be processed, even if activity is low.
  • Sorting of transactions is required.
  • File enquiry is slow.

Other sensible answers should also receive credit.

 

(ii) Indexed sequential
[1]

One mark should be awarded for a valid point. Examples include the following:

  • Each master file access requires index file access(es).
  • A direct access storage device is required.
  • Storage space for indexes is required.

Other sensible answers should also receive credit.

 

(iii) Random
[1]

One mark should be awarded for a valid point. Examples include the following:

  • It is difficult to get a good spread of record addresses.
  • Synonyms may occur, therefore overflows must be handled.
  • If the hit-rate is high, then the processing becomes slow.

Other sensible answers should also receive credit.

 

(d) Describe how a file checker detects inconsistency.
[2]
The file checker builds a table, with two counters per block (1 mark). It reads the blocks in use and free blocks, and updates the counter accordingly (1 mark).

Other sensible answers should also receive credit.

 

(e) Given the following state of a file, list the blocks which are inconsistent and, for each inconsistent block, name the type of inconsistency.

 

Block number

0

1

2

3

4

5

6

7

8

9

10

11

12

13

In Use

1

0

1

0

0

1

2

1

1

0

1

0

0

0

Free

0

0

0

1

1

0

0

0

0

1

0

1

2

1

 

One mark is available for each of the following:

  • Block 1 – missing block (1 mark).
  • Block 6 – duplicate data block (1 mark).
  • Block 12 – duplicate block in free list (1 mark).

 

[3]
(f) For each of the errors mentioned in Part (b), describe how the file checker might rectify the inconsistency.
[3]

One mark is available for each of the following:

  • Missing block – Add to the free list.
  • Duplicate data block – Contents are copied into a free block, inserted into one of the files, and the error is reported.
  • Duplicate block in free list – Rebuild the free list.