COMPUTER PROGRAM

A computer program is a set of instructions to be followed by the computer. These instructions are the steps to be followed sequentially in order to achieve the result.

CHARACTERISTICS OF A GOOD PROGRAM

1. Accuracy : The program must do what it is supposed to do and meet the critical laid down in its specification.

2. Reliability : The program must always do what it is supposed to do and never crash.

3. Efficiency : The program must use the available store space and resources in such a way that the system speed is not waste.

4. Robustness : The program should cope with invalid data without stopping with no indication to the cause and without creating errors.

5. Usability : The program must be easy to use and well documented.

6. Maintainability : The program must be easy to amend having good structuring and documentation.

7. Readability : The code in the program must be well laid out and explained with comments.

8. Portability : It should be seen that the program is easy to transfer to other machines as well.

TYPES OF DATA

Constants : This is the data which is predetermined before a program is used. Values remain unchanged during the execution of a program.

Variables : Here the data may change or be assigned different values as the program runs.

OP CODE & OPERAND

A Machine language instruction normally has a two part format. The first part is an instruction , is the operation code, that tells the computer what function to perform, and the second one is operand, that tells the computer where to find or store the data or other instructions that are to be manipulated.

All programming languages has its own syntax, rules or grammar. So we should follow the syntax of the programming language in which we are programming. Breaking any of these will cause bugs or Errors in our program.

Logic, Run time & Syntax Errors

Syntax Errors arises due to the lack of knowledge in the programming language syntax. It arises because of the error in the syntax of programming instructions. Programs having syntax errors cannot be compiled or executed. Compilers will show syntax errors in the program specifying the line number and information about the error.

Logic Errors are another kind of error and causes because of the faulty or bad logic of the programmer. It may result in the programs functionality and often produce undesired output. For example instead of adding two numbers like a+b, programmer coded like a-b; Programmer used a-b instead of instruction a+b. This type of errors cannot be detected by compilers because instructions may be valid (both a+b and a-b are valid instructions) but it has some logic errors and the program will results undesired or unpredictable result.

Run time Errors are errors occur when a program executes. Compilers cannot predict the run time errors in the program. Its arises only when a program runs. eg. Division by Zero Error.

Previous
Next

0 comments:

Design by The Blogger Templates The Blog Full of Games

© CourseZone
2008 - 2010 All Rights Reserved.