Computing (Modular) 
CP4
 June 2005

(2 Hours)

1. A company's sales department uses a computer system to store information about its sales staff.
 
(a) Give an example of sales staff data which would be best stored in the form of a record, explaining why a record is the most suitable data structure in this case. [2]
   
(b) Using a diagram, give an example of sales staff data which would be best stored in the form of a three dimensional array. [2]
   
 
2. (a) A graphical user interface and a text based interface are two different types of Human-Computer Interface (HCI)  
  (i) Describe three benefits of a graphical user interface over a text based interface. [3]
   
  (ii) Describe two benefits of a text based interface over a graphical user interface. [1]
   
(b) Hand held computer devices often use handwriting recognition as a means of input.  
  (i) Describe one feature which makes this form of input very suitable for hand held computers. [1]
   
  (ii) Describe one drawback of this form of input. [1]
   
(c) Two other examples of HCI are forms dialogue and natural language interface. Briefly explain each of the terms:  
  (i) forms dialogue [1]
   
  (ii) natural language interface [1]
   
(d) Describe how an HCI can be evaluated. [1]
   
     
3. Explain the following terms when used in connection with storing numbers in a computer.  
(a) Overflow [1]
   
(b) Underflow [1]
   
     
4. (a) The following diagram shows a type of data structure. It contains a number of integers. In each case the right pointer indicates the condition 'higher number' and the left pointer indicates the condition 'lower or equal number'.  
 

 
(i) Write down the name of this data structure. [1]
   
(ii) Write down the integer contained in the root node. [1]
   
(iii) Write down the order in which the nodes would be accessed to find the integer 2528. [1]
   
(iv) Copy the tree and show where a new node, containing the integer 3106 would be added. [1]
   
(v) The integer 2550 is not in the diagram. Explain what would happen if a search was made for this integer. [1]
   
(b) Write down the names of two other data structures. In each case draw a simple diagram to illustrate the data structure. [4]
 

 

 
     
5. (a) In a certain computer, two's complement is used to represent negative integers, using 8 bits.  
  (i) Show how the number -710 is represented. [1]
   
  (ii) Showing your working, demonstrate that 1310 is the result of the binary addition of -710 to +2010. [2]
 

 

 
(b) In another computer, a sign/magnitude approach is used to represent integers using 8 bits. Explain what is meant by the term sign/magnitude, giving a clearly labelled example. [2]
   
(c) In another computer, the character '1' is stored as 00110001. The character '2' is stored as the next higher binary code (00110010) and so on. How will the character '5' be stored? [1]
   
     
6. (a) State two methods of describing algorithms. [2]
   
(b) (i) A recursive algorithm is an algorithm which calls itself. Describe one other key feature of a recursive algorithm. [1]
   
  (ii) Describe one advantage of a recursive algorithm [1]
   
(c) A certain computer program has one main section, and may have a number of procedures. Data used in the main section is often also required and can be passed via a parameter. Parameters can be passed by reference or by value.  
  (i) Describe what is meant by the term passing by reference and give one benefit of using this method. [2]
   
  (ii) Describe what is meant by the term passing by value and give one benefit of using this method. [2]
   
     
7. (a)  J is eight-digit binary number 10011010

 K is eight-digit binary number 00111000

 
  (i) Write down the effect of carrying out the logical operation NOT J [1]
   
  (ii) Write down the effect of carrying out the logical operation J XOR K [1]
   
(b) M is the eight-digit binary number number 10000000

M is used in a masking process.

 
  (i) State what logical operation is used during masking. [1]
   
  (ii) What effect would masking with M have on any eight-digit binary number? [1]
   
     
8. (a) Explain what is meant by the term interpreter. [1]
   
(b) Lexical analysis is one process involved in compiling a computer program, and an output from this process is a symbol table. Describe what happens during lexical analysis, making clear the role of the symbol table. [2]
   
(c) Explain what is meant by the term linking loader. Give an example of a situation where a linking loader would be used. [2]
   
     
9. (a) In a certain computer language, variable names are defined according to the following diagram.  
   
  (i) What is name of this type of diagram? [1]
   
  (ii) Give a four character example of a variable name permitted in this language. [1]
   
(b) (i) Backus Naur Form (BNF) is often used to describe the syntax of a computer language. Give one reason why BNF might be used in preference to English. [1]
   
  (ii) A definition of a word is necessary for a spell checker within a word processor.

The definition used is as follows:

A word contains one or more characters and must:

  • begin with a letter
  • be made up of letters, hyphens (-) and apostrophes (') only

You may assume that all letters have already been converted, if necessary, to lower case.

Produce an appropriate BNF definition for a word.

[4]
   
     
10. An array Values[1..n] contains a number of integer values. The array elements are not necessarily in ascending or descending order.

Design an algorithm (in pseudo-code or a high-level programming language) which will carry out a linear search of the array for a given search element. If the element is found, it should output the position of the search element. If the element is not found, the algorithm should output zero.

[4]
   
     
11.  In the following question, additional credit (up to 3 marks) will be gained if your answer demonstrates skill in written communication.

A programming team is attempting to produce a very high quality suite of programs, which are to be used in connection with a safety-critical application in a chemical plant.

Various devices have to be made by the team, including the type of language to be used, for instance whether the language will be :

  • a procedural language
  • a non-procedural language
  • a fourth generation language
  • a visual programming language

The team has a number of software tools available, for instance

  • CASE tools
  • debugging tools

Describe in detail the features of the different programming language types in the above list and explain how they might influence the choice of language.

Also describe in detail the role of the two named software tools in assisting the programming team.

[8+3]