Computing (Modular) 
CP4
June, 2002
(2 Hours)

1. Many companies use software packages to solve problems rather than using a traditional programming language.
(i) Describe two possible benefits of this package-based approach compared with the use of a programming language. [2]
(ii) Describe one drawback of this package-based approach compared with the use of a programming language [1]
 
2. R is the six-digit binary number   101010
S is the six-digit binary number   110011
(i) Write down the effect of carrying out the logical operation  R AND S [1]
(ii) Write down the effect of carrying out the logical operation   NOT R [1]
 
3(a) A stack is a type of data structure.
(i) Explain what is meant by the term data structure. [1]
(ii) Explain, using a diagram, the term stack, and outline what should happen when an attempt is made to to remove an item from an empty stack. [3]
(iii) When would a stack be used in a computer system?
     Why is a stack the most appropriate data structure in this case?
[2]
(b) Goodevenings is a company with shops throughout the country which sell the following categories of products:
  • compact discs;
  • computer games;
  • books;
  • magazines;
  • board games.

For each of these categories, sales figures for one shop were recorded every month in 2001.

(i) Describe, using a diagram, a suitable data structure for this application. [2]
(ii) State an appropriate data structure if this system is extended to store sales figures from all the shops in the company. [1]
 
4(a) In a certain 8-bit computer, all integers are stored in binary, and negative integers are stored in two's complement form.
(i) Show how the number  +3610 is represented. [1]
(ii) Show how the number -1210 is represented. [2]
(b) (i) Describe an advantage to a user of representing numbers in hexadecimal instead of binary. [1]
(ii) Convert the binary number   1001000111102   to hexadecimal. [1]
(c) Describe how a character may be represented in binary. [1]
(d) Show the effect of a logical shift right by one place on the following 8-bit number:
10110110.
[1]
 
5(a) There are various types of programming languages.
(i) Describe each of the following types of language, and give an example of a suitable use for the language in each case:
I.   a procedural language; [2]
II.  a non-procedural language. [2]
(ii) Describe a situation where a special purpose language would be useful and describe why it would be preferable to a general purpose language in this case. [2]
(iii) Describe a situation where a fourth generation language would be useful and describe why it would be particularly suitable in this case. [2]
(iv) Describe a situation where a visual programming language would be useful and describe why it would be particularly suitable in this case. [2]
(b) When a programmer is developing a computer program, she uses a variety of computer tools, including computer aided software engineering (CASE) tools and debuggers.
(i)  Explain what is meant by the term CASE tool and describe how it will help the programmer. [2]
(ii) Describe two facilities available in a debugger. [2]
 
6(a) Backus Naur Form (BNF) is often preferred to English as a means of defining syntax rules. Why is BNF so useful? [2]
(b) A certain program needs to have a definition of what is meant by a command word.

The definition is as follows:

A command word...

  • must be made up of letters and digits only;
  • must begin with a letter.

Produce an appropriate Backus Naur Form (BNF) definition for a command word.

[4]
 
7(a) Explain what is meant by the term algorithm. [2]
(b) State two methods of describing algorithms. [2]
(c) (i) Describe the key features of a recursive algorithm. [2]
(ii) Describe one advantage of a recursive algorithm when available. [1]
 
8(a) Describe the following stages of the compilation process:
(i)  lexical analysis; [2]
(ii) syntax analysis. [2]
(b) Describe the function of a linking loader. [1]
 
9. Consider the following algorithm.
Line  
1 repeat
2     finished := TRUE
3     for i := 1 to n-1
4         if value[i] <= value[i+1]
5             temp := value[i+1]
6             value[i+1] := value[i]
7             value[i] := temp
8             finished := FALSE
9         endif
10     endfor
11 until finished = TRUE
(i) What is the function of this algorithm? [1]
(ii) What will be the effect of the algorithm if:
n=5
value[1] = 3
value[2] = 4
value[3] = 2
value[4] = 6
value[5] = 10 ?
[1]
(iii) The algorithm will fail if:
n=5
value[1] = 3
value[2] = 6
value[3] = 2
value[4] = 6
value[5] = 10
I.   Describe what feature of the data will make the algorithm fail in this case. [1]
II.  What will happen when the data is used? [1]
III. What alteration to the algorithm will ensure the algorithm works correctly for this data? [1]
 
10. In the following question, additional credit (up to 3 marks) will be gained if your answer demonstrates skill in written communication.
When a new computer system is designed, considerable attention is paid to the design of the human computer interface (HCI). Various approaches are possible, for instance, in the use of text based or graphical user interfaces, speech recognition and handwriting recognition, and speech synthesis. In some cases a natural language interface is also employed.

Describe the issues involved in the design of the HCI, with reference to the terms shown in italics (green) above. You should include a description of how the design of the HCI should be evaluated.

[9+3]