April 2000
SW204 : SOFTWARE AND
FILE DESIGN

QUESTION 1 (Compulsory)

Total Marks: 30 Marks

Click here to access other questions

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

(a)(i)What is a resource allocation graph [1mark ]
A resource allocation graph is a graphical tool used to model eadlock.
Other valid answers should also receive credit. [1 mark ]

(ii)Describe two deadlock recovery methods.[4 marks ]

One mark should be awarded for each valid point, and a further mark should be awarded for each satisfactory elaboration (up to a maximum of four marks).
Examples include the following:
•Preemption (1 mark). This involves taking resources away from one process and allocating them to another process (1 mark).
•Rollback (1 mark). This involves taking periodic checkpoints and, if a
deadlock occurs, the process that owns the required resource is rolled back to the previous checkpoint (1 mark).
•Killing the process (1 mark). This involves killing one or more processes in
the deadlock cycle (1 mark). Other valid answers should also receive marks. [4 marks ]

(b)(i)List two tasks which are performed during lexical analysis.[2 marks ]
One mark should be awarded for each valid point (up to a maximum of two marks). Examples include the following:
•Changing the source code into a form which is independent of the input
device.
•Standardising formats and removing spaces and comments.
•Converting reserved words and composite symbols into tokens.
Other valid answers should also receive marks. [2 marks ]
(ii)In the context of the compilationp ocess, define the term code generation [2marks ]
The intermediate code, which is in a tokenised form, is converted to its machine code equivalent (1 mark). This is accomplished by looking up each entry in the directory, and its equivalent address being inserted into the machine code inst rction (1 mark). Other valid answers should also receive marks. [2 marks ]
(iii)What are syntax and semantic errors?[2 marks ]
A syntax error occurs when a source program does not conform to the syntax rules of the source code (1 mark), while a semantic error occurs when there is a problem with the meaning of the program, e.g., the transfee of control to statements which do not exist (1 mark). Other valid answers should also receive marks. [2 marks ]

(c)(i)Describe one advantage of custom-built software.[2 marks ]
One mark should be awarded for a valid point, and a further mark should be awarded for a satisfactory elaboration. Examples include the following:
•Usually suitable (1 mark).Custom-built software is developed on the basis of requirements specifications (1 mark).
•Efficient (1 mark).The code is optimised: only code which is relevant to the function is developed (1 mark).
•Easily modified (1 mark). Alterations to the code can be made easily as the source code and documentation is readily available (1 mark). Other valid answers should also receive marks. [2 marks ]
(ii)Desc ibe one disadvantage of custom-built software.[2 marks ]
One mark should be awarded for a valid point, and a further mark should be awarded for a satisfactory elaboration. Examples include the following:
•Expensive (1 mark). A budget is required fo the additional resources related to development, installation, and training (1 mark).
•Slow acquisition (1 mark). Time is spent in analysing, designing, developing, testing, and implementing the software (1 mark).
•Limited feedback from other users (1 mark). Normally such software is tailored to the needs of the major users within the organisation, and feedback is received from only these individuals (1 mark). Other valid answers should also receive marks. [2 marks ]

(d)Define the following terms:
(i)Reconstruction mode.[2 marks ]
The complete original file is amended and written to a different storage area (1 mark). Original records are preserved, resulting in two sets of data at the end of the run (1 mark). Other valid answers should also receive credit. [2 marks ]
(ii)Overlay mode.[2 marks ]
Updated records are written back to the original storage area (1 mark). There is a problem in that there is the potential for damaging the original records (1 mark). Other valid answers should also receive credit. [2 marks ]

(e)(i)What is the main purpose of a directory?[1 mark ]
The main purpose of a directory is to keep track of files. [1 mark ]
(ii)List two advantages of a two-level directory.[2 marks ]

One mark should be awarded for each advantage named (up to a maximum of two marks). Examples include the following:
•It eliminates name conflicts while allowing duplicate file names.
•It can increase security. Other valid answers should also receive credit.
[2 marks ]
(iii)List two advantages of a tree structured directory.[2 marks ]
One mark should be awarded for each advantage named (up to a maximum of two marks). Examples include the following:
•It enables users to organise their files in a logical fashion.
•It allows users to share files within the constraints imposed by passwords
and access rights. Other valid answers should also receive credit.
[2 marks ]

(f)Describe the three essential elements of an expert system.[6 marks ]
One mark should be awarded for each valid point, and a further mark should be awarded for each satisfactory elaboration (up to a maximum of six marks). Examples include the following:
•Knowledge base (1 mark). The knowledge base contains unconditional factual statements, which are represented in the form of rule sets and frames (1 mark).
•Inference engine (1 mark). An inference engine derives results or infers
conclusions from the information contained in the knowledge base (1 mark).
•User interface (1 mark). The user interface obtains user requests, submits
requests to the inference engine, and interacts with the user (1 mark).
Other valid answers should also receive credit. [6 marks ]