Section 3: Program Implementation Flashcards
Low-level languages
These are languages that are machine dependent. Different brands of computers use different program codes. The program code written for a particular brand of CPU will not run on another brand of CPU as the codes are written with the internal operations and architecture of a particular CPU in mind. Examples of low-level languages are Machine language and Assembly language.
High-level languages
These are languages that are machine independent. They are not specifically written for any one brand of computer. The program code written on a particular machine is not limited to execution on that machine only but can also run on other similar machines. Examples of high-level languages are Pascal, BASIC, C, etc.
First Generation Languages (1GL)
These are low-level languages. They are called machine language and are written using 1’s and 0’s i.e. binary code. It is the only program code that the CPU understands and can obey or execute directly without the need to translate it.
Second Generation (2GL)
These are also low-level languages. They are called Assembly language and are written using mnemonic codes- short codes that suggest their meaning and are therefore easier to remember. These codes represent operations, addresses that relate to main memory and storage registers of the computer.
Third Generation Languages (3GL)
These are high-level languages. This generation of languages was designed so that it is even easier for humans to understand. They are procedural languages which use simple instructions, written in English, to tell the computer step by step how to solve a problem. A compiler is used to convert the English–like statements to machine language.
Fourth Generation (4GL)
These are also high-level languages. Unlike 3GLs, these are non-procedural languages which let you perform computer operations without having to specify all the steps involved. They have built-in methods that can achieve certain goals. 4GLs must be selected to fit a particular application, whereas 3GLs tend to be more general purpose.
Fifth Generation (5GL)
These are high-level languages. This generation is essentially 4GLs with a knowledge base. They are designed to build programs that help the computer solve specific problems based on constraints and conditions. They are applied in expert systems, artificial intelligence research and natural language systems. Examples of 5GLs are Prolog, OPS5 and Mercury.
Steps in Implementing a Program
- Create source code
- Compile source code
- Link the modules
- Run/execute program
- Maintain program
Interpreter
An interpreter translates and executes one instruction at a time as it is encountered.
Compiler
A compiler translates the entire program (source code) to machine code, and then the machine code is executed. The translated codes are known as object codes.
Loading
Reading a program from the hard disk into main memory (RAM)
Dry runs/Manual testing
A manual traversal of the logic of a program. After the development of a program the programmer should examine the code to see how it would run.
A dry run is carried out when the action of an algorithm is examined with a set of input values.
A trace table is a useful tool for a dry run, to check how the program would behave.
Debugging
The process of correcting or removing errors from a program before it is put into operation.
Program Errors
A program error is a mistake/error in a program and is also known as a bug.
Logic errors
Arise when the sequence of the instructions is not correct and there are flawed comparisons and selection statements.