Computing (Modular) 
CP1
January, 2001
(2 Hours)

 

1(a) A program team is developing a suite of programs. Frequently, they need to deal with syntax errors, execution errors and logical errors. In each case, explain the term and give an example.  
(i) syntax error [2]
   
(ii) execution error [2]
   
(iii) logical error [2]
   
(b) Why is it generally easier to find syntax errors than logical errors? [1]
   
 
2(a) Character,string and boolean are names of simple data types.  
(i) Give an example of data which could be held in the character type. [1]
   
(ii) Give an example of data which could be held in the string type. [1]
   
(iii) Give an example of data which could be held in the boolean type. [1]
   
(b) There are at least two numerical data types. What numerical data type is best suited to storing:  
  (i) the number of elements in an array [1]
   
  (ii) the temperature of a liquid in a scientific experiment? [1]
   
 
3 A binary search is used in certain circumstances to attempt to find an element in an array.  
(i) State the major advantage of a binary search over a linear search. [1]
   
(ii) A binary search cannot always be used. In what circumstances is it not suitable to use a binary search? [1]
   
(iii) It can be shown that, for a binary search, it takes around 14 steps to search for an element in an array of 10000 items. Assuming this is true, what would be the corresponding figure for an array of 20000 items? [1]
   
 
4. Different programming languages are used in different application areas.  
(i) Certain programming languages are used for commercial applications, while others are used for scientific applications. Describe one feature which it would be useful to have in each of the following:  
  I. a language used in a commercial application; [1]
   
  II. a language used in a scientific application. [1]
   
(ii) Hypertext mark-up language (HTML) is an example of a language which is used to produce web pages. Explain why this type of language is suitable for this application. [2]
   
(iii) A source code program is often input to a translation program. Explain the two terms:  
  I. source code program [1]
   
  II. translation program [1]
   
 
5. An office worker uses a computer package which contains a word processor and a spreadsheet.  
(a) There are benefits and drawbacks of using an integrated package of this type compared with using separate word processing and spreadsheet packages.  
  (i) Describe two benefits of the integrated approach; [2]
   
  (ii) Describe one drawback of the integrated approach. [1]
   
(b) The worker frequently uses the following features:  
 
  1. header/footer
  2. mail merge
  3. macro

Explain each of these terms. In each case, give an example of the use the office worker might make of the feature.

[6]
   
 
6. Records and two-dimensional arrays are examples of data structures which a manufacturing company uses to store information about its sales staff and their sales.  
(i) Give a detailed example of sales staff information which might be stored in the form of records, and state why this data structure is suitable in this case. [2]
     
(ii) Give a detailed example of sales information which might be stored in the form of two-dimensional arrays, and state why this data structure is suitable in this case. [2]
     
 
7. The following algorithm is intended to output the maximum value in an array of positive integers. The array is called cost and has n values from cost[1] to cost[n].  
 
set max := cost[1];
set pos := 1;
for count := 2 to n
    if cost[count] > max
        then
            set max := cost[count]
            set pos := count;
    endif;
next count;

output (max, pos)
 
 

(i) What other item of information does the algorithm output?

[1]
   
  (ii) What will happen if the array contains two or more equal values? [2]
   
  (iii) The loop in this algorithm is controlled by the variable count. An alternative method of controlling a loop would be by the use of a rogue value. Give an example of a suitable rogue value in this case and state where the rogue value should have been placed in the data. [2]
   
 
8. After an electricity meter reader has visited a number of customers' homes, he or she inputs all the data into the company's computer system. In each case, a check is then made that the current meter reading is not far too large or far too small compared with the reading taken six months ago, which would suggest an error had been made. If this check is satisfactory, the new figure is included in the data held for each customer.

The situation described so far is shown in the diagram below:

 
 

 
  (i) Write down the name for this type of diagram. [1]
   
  (ii) Describe why this type of diagram is particularly useful to systems analysts. [1]
   
  (iii) What type of object does the open box symbol in the diagram represent? [1]
   
  (iv) Give a suitable name for this object (shown as a) [1]
   
  (v) What type of object does the arrow symbol in the diagram represent? [1]
   
  (vi) Give a suitable name for the object shown as b in the diagram. [1]
   
  (vii) Give a suitable name for the object shown as c in the diagram. [1]
   
 
9(a) A small shop still uses a paper-based system to control its stock flow. Imagine that you are asked to carry out a systems analysis and design for a new computer-based system for stock flow.

The new system must support the following operations:

  • maintain records of all the stock
  • maintain records of all sales

As systems analyst, you will need to carry out a number of tasks.
Making any reasonable assumptions you wish about the existing paper-based system, describe each of the following tasks in detail, making it clear how you would carry out each task in this case.

 
  (i) feasibility study [2]
   
  (ii) analysis of the existing system [2]
   
  (iii) data validation [2]
   
  (iv) design of the user interface [2]
   
(b) When a new system is implemented, there is usually a changeover period.  
  (i) Explain the term changeover [1]
   
  (ii) Why is it useful that the old system should still be available? [1]
   
(c) After a computer system is developed, there are often post-implementation costs. Give two examples of post-implementation costs and state in each case how the cost can be minimised. [4]
   
 
10 In the following question, additional credit (3 marks) will be gained if your answer demonstrates skill in written communication.

A company wishes to undertake a substantial software development. Software is normally written in the form of modules. This approach often makes use of standard modules and most programmers use some form of self-documenting code.

Describe in detail why it is useful to organise a program into modules and explain what is meant by the term standard module, giving one example of a task which might be carries out by a standard module. Also explain two advantages of using standard modules.

Explain why it is sensible to use self-documenting code, giving two different examples.

[7+3]