Wednesday, July 23, 2008

Computer Science Questions and Answers I

1. (a) Distinguish between operating system software and applications software. [2]

(b) State three utility programs associated with the use of a hard drive. Explain the purpose of

each of the programs. [6]

Answer:

1 (a) - OS controls operation of system/hardware

- Applications software allows the system to do something useful (2)

(b) - File handling

- Copy/move/delete

- Anti virus software

- To protect files from attack by virus

- Defragmentation

- To keep files sensibly arranged on the hard drive

- Format

- To divide surface of drive into smaller areas to aid storage

(1 per -, max 6) (6)

2 (a) State what is meant by each of the following modes of use.

(i) Batch processing.

(ii) Real-time processing.

(iii) On-line processing.

(iv) Off-line processing. [4]

(b) A computer game involves driving a racing car around a track. State which two of the above

modes of use would be appropriate, justifying your answers. [4]

(c) State two advantages and one disadvantage of having a network of computers, rather than

a series of stand alone machines, in a school classroom. [3]

Answer:

2 (a) (i) Jobs collected together for processing at a later time

(ii) Output produced quickly enough to affect the next input

(iii) User has direct contact with processor

(iv) User cannot communicate directly with processor (4)

(b) - Real time

- E.g. turning the wheel must turn the car immediately

- On line

- Otherwise system cannot be real time (4)

(c) - Sharing of software and data files

- Sharing of hardware, e.g. printers

- Communication

- Security of files more of a problem

(1 per -, max 3) (3)

3 (a) Describe each of the following types of program error, giving an example in each case.

(i) Syntax error.

(ii) Logic error.

(iii) Arithmetic error. [6]

(b) Describe two methods used to assist in finding program errors. [4]

Answer:

3 (a) (i) Incorrect use of language, e.g. PLINT instead of PRINT

(ii) A mistake in the structure of the solution, e.g. a jump goes to

the wrong line

(iii) Inappropriate arithmetic is used, e.g. division by 0

is attempted (6)

(b) - Translator diagnostics

- Produced when wrong programming used

- Gives position and explanation of error

- Cross-referencing

- Used when program modularised

- To check use of variables

- Trace routines

- Follow value of variable

- To give clue as to where error occurs

- Variable dump

- Prints values of all variables

- At given point in program

(1 per -, max 2 per type, max 4) (4)

4 (a) Explain what is meant by a LIFO data structure. [2]

(b) Draw a simple diagram to show how a stack can be stored in an array. [2]

Answer:

4 (a) - Data enters at one end (of a stack)

- Leaves at the same end

- Hence 'last in, first out'

(1 per -, max 2) (2)

(b)

5 A company employs approximately 2000 workers whose details are stored in a personnel file in a

computer system.

Each worker's record has a unique 7 digit identification number.

_ The first digit is from 0 to 5 and refers to the department in which the person works.

_ The second digit is a 0 or a 1 and refers to the sex of the employee.

_ The next two digits refer to the year that the employee joined the company.

_ The last three digits are used to make the identification number unique.

The file is accessed randomly by using a hash table.

(a) Devise a suitable hashing algorithm which limits the degree of redundancy to allow access to

the hash table. [2]

(b) State two identification numbers that will cause a collision using your hashing algorithm. [1]

(c) Describe two methods to overcome the problem of collision in part (b). [4]

Answer:

5 (a) - Uses all 7 digits

- Creates >2000 results

- Highlight the danger of multiplying by zero (2)

(b) Any two 7 digit numbers that cause a clash (1)

(c) - Search serially from hash value

- Until vacant location found

- Mention of circular reference

- If the memory locations become full, use a bucket

- Use bucket to place duplicates in

- In serial form

- Pointer to bucket from hashed location

- Use hashed location as start of linked list

- Ensure end of list with null value of pointer

(1 per -, max 2 methods, max 4) (4)

6 (a) Describe the purpose of the

(i) control unit

(ii) memory unit

(iii) arithmetic logic unit

in a computer. [6]

(b) Explain the difference between main memory and secondary storage. [2]

Answer:

6 (a) (i) To manage the execution of instructions

By running a clock

To decode instructions

(ii) To store OS

To store those parts of applications programs currently running

To store data currently in use

(iii) Part of processor where data is processed/manipulated

All I/O must pass through here

(1 per -, max 2, 2, 2, max 6) (6)

(b) - Main memory transitory, secondary storage is (semi-)permanent

- Processor can only use data/instructions that are in main memory

- Main memory in processor, secondary storage not

(1 per - max 2) (2)

7 (a) Explain the difference between

(i) serial and parallel,

(ii) simplex and duplex

modes of data transmission. [4]

(b) When data is transmitted it is subject to corruption. Explain how a parity check could be used

to determine whether corruption has taken place. [4]

4

The remaining questions refer to the following information.

A college stores its student files on paper which is kept in filing cabinets. The decision is taken to

computerise these student files.

A systems analyst is employed to supervise the process.

Answer:

7 (a) - Serial is the transmission of data one bit at a time/through one wire

- Parallel is the transmission of data more than one bit at a time/many wires

- Simplex is the transmission of data in one direction only

- Duplex is the transmission of data in both directions simultaneously (4)

(b) - Extra bit on each data-byte that

- Does not transmit data

- Makes number of ones in a byte be always even or always odd

- Error in the transmission of a bit will make the even/odd wrong

- Problem of two errors in one byte not being found

- Parity block

(1 per -, max 4)

0 comments: