Saturday, March 23, 2013

Errors

Errors

Errors

The T40 microcomputer system has a high level language interpreter.

(a)

(i) Explain how a syntax error can occur.

(ii) Explain how you would find the syntax error.

(b)

(i) Give and explain an example of a logical error.

(ii) Explain how to find the logical error.

A program is executed and produces results which are found to be incorrect. List three

different methods the programmer can use to locate a mistake in the program.

A company records the workers clocking in and out times on time sheets. There is no night shift. The format for each sheet is: A five digit works number, followed by 5 or 6 pairs of times in 24 hour clock notation, (time of arrival followed by time of leaving), each field separated by a slash/. An example is shown below. It has three errors in it.

20023/0900/1703/170610859/0858/1659/090111702/08591170841090011330

(a) Find the three errors and draw a ring around each.

(b) For each error give a validation rule that might be used in the data entry program to detect it.

In a certain program, some checks are made when the user enters the year of birth. These are:

field length check range check character type check presence

parity check

(a) Write the correct term from the list above in the spaces provided.

Has something been entered?

Is it made up Of numbers only?

Is it before 1986 and after 1880?

Is the entry 4 digits long?

(b) The same program will also require the user to enter his place of birth. Write down three checks which may be made when this has been input.

(c) Complete the sentence:

Character type checks and range checks are both types of data

A date is to be entered into a computer program in the form ddmmyy where dd is the day of the month, mm is the month and yy is the year. For example 230481 would be the 23rd Apri11981. Describe clearly the three following validation techniques that could be used to test the data:

(a) Find the three errors and draw a ring around each.

(b) For each error give a validation rule that might be used in the data entry program to detect it.

In a certain program, some checks are made when the user enters the year of birth. These are:

field length check range check character type check presence

parity check

(a) Write the correct term from the list above in the spaces provided.

Has something been entered?

Is it made up Of numbers only?

Is it before 1986 and after 1880?

Is the entry 4 digits long?

(b) The same program will also require the user to enter his place of birth. Write down three checks which may be made when this has been input.

(c) Complete the sentence:

Character type checks and range checks are both types of data __

A date is to be entered into a computer program in the form ddmmyy where dd is the day of the month, mm is the month and yy is the year. For example 230481 would be the 23rd Apri11981. Describe clearly the three following validation techniques that could be used to test the data:

(a) Length check.

(b) Format check.

(c) Range check.

Part of a vehicle main me is shown below.

Field

Length

Description

Example

1

7

registration mark

D847TBH

2

7

vehicle make

BL

3

8

model

MAESTRO

4

6

colour

BLUE

5

4

engine size

1300

6

1

taxation class

P

Part of a vehicle main me is shown below.

(a) Why is the taxation class coded as a single letter?

(b) Whilst the data is being entered into the computer it is verified and validated.

(i) How would the data be verified?

(ii) Using the registration mark A123 XYZ describe the meaning of the term validation.

Integer overflow can happen whilst the CPU is executing an arithmetic instruction. Show how by working through a sum. Label the point where the integer overflow would occur. (Your sum may be in binary or in ordinary base 10 numbers).