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] | ||||||||||||||||||||||||||||||||||||
If a data item is removed it is removed from the TOS position (Tomkins) and the TOS pointer is decremented. |
|||||||||||||||||||||||||||||||||||||
(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:
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...
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. | ||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||
(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] | ||||||||||||||||||||||||||||||||||||
value[1] = 10
value[2] = 6 value[3] = 4 value[4] = 3 value[5] = 2 |
|||||||||||||||||||||||||||||||||||||
(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] | ||||||||||||||||||||||||||||||||||||
The HCI needs to be designed to suit the IT
skills of the users and the environment where the computer will be
used needs to be considered - will it be noisy, dark, etc.
Text-based interfaces offer the most options but the user will need to know the commands required and must enter them with no spelling mistakes. Each command may have a number of options ('switches') available. Eg the DIR command may be entered with a switch DIR /W to opt for a wide-screen display. Graphical user interfaces (GUIs) are more appropriate for less-skilled users. The use of meaningful icons and a mouse to select them offers an intuitive and 'user-friendly' approach. Speech recognition systems allow the user to speak commands into microphones. The operating system then interprets the sound received and acts accordingly. There are many problems with this method as users speak differently (different accents, languages etc) and would not be usable in a noisy environment such as a busy office. Any output may be given as speech through speakers using speech synthesis. Natural language interfaces enable a person to speak to the computer as if it was another person and issue commands to it. Although this is the most 'user-friendly' approach it is not reliable as language is complex and diverse and a globally usable system is difficult to develop. Handwriting recognition systems require the user to write on the screen or a pad, but people's handwriting also varies considerably so these systems are not generally reliable. The evaluation of a HCI should be done by asking the users whether they found the system easy to use and error-free, or ,if there were alternative methods, how many users used which system.
|
|||||||||||||||||||||||||||||||||||||