Universidad de Los Lagos
Prof. M. Luisa Troncoso G.
2nd Term / 2.009
PROBLEMS AND SOLUTIONS
There canbe different kinds of errors in computing. Let’s see some of them.
A) System errors: they affect the computer or its peripherals. For example, you might have written a program which needsaccess to a printer. If there is no printer present when you run the program the computer will produce a system error message. Sometimes a system error makes the computer stop working altogetherand you will have to restart the computer. A sensible way of avoiding system errors is to write code to check that peripherals are present before any data is sent to it. Then the computer wouldwarn you by a simple message on the screen, like “ printer is not ready or available”.
B) Syntax errors: they are mistakes in the programming language ( like typing PRNIT instead ofPRINT) . Syntax errors cause the program to fail.
Some translator programs won’t accept any line that has syntax errors. Some
only report a syntax error when they run the program.Some languages also
contain special commands which will report structural errors in the program.
C) Logic errors : they are much more difficult to detect than syntax errors.This is
because a program containing logic errors will run, but it won’t work properly.
You can get rid of logic errors from simple programs by “ hand-testing” them ordoing a dry run which means working through each line of the program on
paper to make sure it does what you want it to do.You should do this long
before you type inthe code.
ACTIVITY : match these problems and solutions.
1. connect a computer to a ____ write code to check a
Leer documento completo
Regístrate para leer el documento completo.