|
|||||||
|
|
|
|||||
|
|
|||||||
August
1999 SECTION B [60 Marks] |
Click here to access other
sections Section A Front Cover SUGGESTED SOLUTIONS
|
Answer ANY TWO questions
in this section
|
||
| 1. | (a) A linear search for a
particular record in an array of records works as follows. Suppose that there are N
student records (stud_rec) in a student file. A counter, 'i', is set to 1 to start
searching from the first record. A flag, 'found', is set to false before searching starts.
Once the target record is found, 'found' will be set to true so that the searching loop
will be terminated. There are two conditions for the loop : the first involves the value of 'found' and the other involves the value of 'i'. If both conditions are true, stud_rec[i] is compared with the target record. If there are equal, a message should be displayed giving the position of the target in the array. The value of 'found' is then set to true. If target is found, the value 'i' is incremented by 1 to go to the next record. The entire process is repeated until the value of 'found' is set to true or the value of 'i' no longer lies between 1 and N. After the loop, the value of 'found' is checked: if it is false, a message is displayed saying that the target has not been found in the student file. Construct a flowchart which
describes the above linear search algorithm. Having correct symbol for both
'start' AND 'stop'
|
[16] |
| (b) Identify the three
types of programmers in the programming group. For each, state two of the job
responsibilities for members of that group. Analyst Programmers System Programmers Application Programmers
|
[9] | |
| (c) (i) Explain briefly what a recursive procedure is. (ii) Give one advantage and one disadvantage of using
recursion as compared to iteration. Disadvantage: less efficient, in terms of computer time, than iteration because of the overhead for the extra procedure calls
|
[3] [2] |
|
| 2. | (a) Give two
advantages of each of the following program design checking methods:
|
|
| (i) Dry run Causes the designer to take a second hard ;look at the detail of the design ensuring that the initial design is proven before code is written
|
[2] | |
| (ii) Structured walkthrough [Any two of the following] Early exposure of problems Interaction between team members Education of team members Constant awareness of progress Consistency of design approach within the group
|
[2] | |
| (iii) Independent inspection Allow a person other than the author to see the potential problems and evaluate them objectively so a different view or unidentified problem may be spotted
|
[2] | |
| (b) (i)Explain what is involved in Program Maintenance. (ii) Give three actions
programmers can take on to make program maintenance easier.
|
[4] [3] |
|
| (c) An employee record is made up
of the following fields : Employee number Employee date of birth Employee address Employee basic salary Category of job (managerial or non-managerial) Employee part job(s) history (designation and last drawn salary)
|
||
(i) Create a data structure
diagram for the above record.![]() Start with Employee record(level 1)
|
[9] | |
| (ii) Explain two
differences between data types and data structure, and give two
examples of each. Data type
is a description of data items of the same form (Do not accept numeric /
non-numeric)
|
[8] | |
| 3. | (a) Explain what is meant by a
test harness and a dummy stub. You may use the diagram below to help your explanation.
Test harness : Dummy stub :
|
[8] |
| (b) (i) State the purpose of SQA. It is a planned and systematic series of actions that are performed to ensure quality in software (ii) List the major activities which are involved in SQA. Application of technical methods
|
[2] [7] |
|
| (c) (i) Explain briefly the differences between limited entry and mixed entry decision tables. Limited entries decision table : (ii) Write brief notes to explain what is meant by a decision table preprocessor. Mixed entried decision table :
|
[4]
[4] |
|
| (d) Use pseudocode to construct a
for-loop which prints out all odd numbers between 1 and 10. FOR i IN RANGE 1 TO 10
|
[5]1 |