Section 3: Program Implementation Flashcards

1
Q

Low-level languages

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

High-level languages

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

First Generation Languages (1GL)

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Second Generation (2GL)

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Third Generation Languages (3GL)

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Fourth Generation (4GL)

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Fifth Generation (5GL)

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Steps in Implementing a Program

A
  1. Create source code
  2. Compile source code
  3. Link the modules
  4. Run/execute program
  5. Maintain program
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Interpreter

A

An interpreter translates and executes one instruction at a time as it is encountered.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Compiler

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Loading

A

Reading a program from the hard disk into main memory (RAM)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Dry runs/Manual testing

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Debugging

A

The process of correcting or removing errors from a program before it is put into operation.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Program Errors

A

A program error is a mistake/error in a program and is also known as a bug.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Logic errors

A

Arise when the sequence of the instructions is not correct and there are flawed comparisons and selection statements.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Syntax errors

A

Occurs when the source code has not been written in accordance with the rules of the programming language.

17
Q

Run-time errors

A

Generated during execution of the program. They result when the processor encounters an instruction that violates the processing rules.

18
Q

Loops

A

The group of statements/instructions to be repeated is called a loop. There are two (2) types:

  1. A finite loop – where the number of times a repetition is to be made is known.
  2. An infinite loop – where the instructions are repeated an unspecified number of times.
19
Q

WHILE loop

A

This construct is used when you do not know beforehand how many times a statement within a block needs to be repeated. In this loop the computer executes the instruction to be repeated for as long as a given condition is TRUE. It checks the conditions first and will loop while the condition is true and ends when it is false.

20
Q

FOR loop

A

This construct is used when the number of times a set of instructions has to be repeated is known.

21
Q

Repeat .. Until Loop

A

This construct is similar to the WHILE loop, in that, it can be used when you do not know beforehand how many times a statement within a block needs to be repeated. The difference between the WHILE and the REPEAT..UNTIL is that, the computer executes the instruction(s) to be repeated for as long as a given condition remains FALSE and ends when it becomes TRUE. Because of this, the instruction(s) to be repeated is/are always executed at least once.

22
Q

Arrays

A

Arrays are used to store values of the same type as one variable. An array is a single variable with multiple locations. Each location stores one element/value.

23
Q

Computer testing

A

Using the computer to run the program with suitable test data (correct and incorrect) to deal with all possible kinds of conditions. The results generated by the computer are then compared with the expected solutions. If the expected and actual results do not match, then the program has a logic error.