Jamaica Gleaner

Programmin­g language

- NATALEE A. JOHNSON Contributo­r

GOOD DAY, students. This is lesson 26 in our series of lessons. In this week’s lesson, we will be looking at programmin­g languages (the beginning of a new unit).

Here is the solution to the practice questions you were provided with in the previous lesson.

QUESTION 1 QUESTION 2

(a) 17 DIV 8 = 2 (b) 17 MOD 8 = 1 (c) /

PROGRAMMIN­G LANGUAGES

Programmin­g languages fall into the following categories:

1. Machine language – Categorise­d as a 1stgenerat­ion language.

2. Assembly language – Categorise­d as a 2nd-generation language.

3. High-level language – Categorise­d as a 3rd-generation language.

4. Fourth-generation language.

These languages can be further categorise­d as either being low-level or high-level languages.

LOW LEVEL

Machine language Assembly language

HIGH LEVEL

High-level language Fourth-generation language

Let us now examine each of these languages.

MACHINE LANGUAGE

This was the first language available for programmin­g. At the machine level, the instructio­ns are written in ones and zero (binary digits). This is the only language that the computer understand­s.

ADVANTAGES

Programs execute fast. Efficient use of memory.

DISADVANTA­GES

Programmin­g is slow and tedious. Code difficult to learn, read, understand and correct.

Code is machine-specific – that is, it cannot be used in the same form on other computer models.

ASSEMBLY LANGUAGE

This was developed to replace the zeros and ones of machine language with symbols that are easier to understand and remember. It uses special codes, called mnemonics (words that suggest meaning), to represent machine language instructio­ns.

An assembly language is translated into a machine language by using a translator program called an assembler. However, both the machine language and assembly language programs are machine dependent, i.e., the way the program is written depends on the operation of the computer.

ADVANTAGES

Programmin­g is faster and less tedious than for machine language.

Code is easier to learn, read and understand than for machine language. I Execution faster than high-level languages.

DISADVANTA­GES

Programmin­g is slower and more tedious than high-level languages. Code is machinespe­cific.

HIGH-LEVEL LANGUAGE

These differ from low-level languages in that they require less coding details and make programs easier to write. They are closer in appearance to natural language, for example, English and French. Programs written in highlevel language are called source code, while the translated version is called object code. These programs must be translated to a form which can be accepted by the computer. This is achieved by means of a special translator programs called compiler and interprete­r.

In contrast to a compiler, an interprete­r does not translate the whole program prior to execution. Rather, it translates the code, line by line, during the execution of the program. With the compiler, all the translatio­n is done, and then the object program is executed. They are not machine-dependent. Examples of high-level language are: BASIC (Beginners All Purpose Symbolic Instructio­n Code), Pascal, COBOL (Common business oriented language), JAVA, C Programmin­g, and so on.

ADVANTAGES

Programmin­g is faster and less tedious. Code is easier to learn, read, understand and correct.

Language is more English and math-like.

DISADVANTA­GES

Program executes slowly.

FOURTH GENERATION

They are often described as very high-level language and referred to as 4GLs. They are easy-to-learn, easy-to-use languages that enable users or programmer­s to code applicatio­ns quicker than they could with lowerlevel languages. Two examples of 4GLs are DBASE and FOXPRO.

ADVANTAGE

Useful for generating reports.

DISADVANTA­GE

Can be very wordy.

KEY PROGRAMMIN­G TERMS

1. Algorithm – It’s a logical sequence of steps designed to solve a problem. An algorithm can be written in any suitable form, such as pseudocode, narrative, and represente­d graphicall­y in a flow chart.

2. Pseudocode – This is an imitation of a computer program written using mathematic­al notations and English-like statements to describe the logic to solve a problem or carry out a procedure.

3. Test data – Data which is used to test a program for errors/special data created by a programmer to test the accuracy of the program.

4. Dry run – This is the process whereby a program is checked to ensure that it does what it was designed for. Test data would be used to test the program written to find the difference of two numbers.

5. Bug – A software bug may be defined as a coding error that causes an unexpected defect, fault, flaw or imperfecti­on in a computer program.

6. Structured walkthroug­h – This is a manual trace of the logics of a program using test data.

7. Runtime errors – Run-time errors occur when a syntactica­lly correct program statement cannot execute successful­ly. A common example is attempting to divide by zero (0).

8. Loading – This is the process of transferri­ng program and data from secondary storage to primary storage.

9. Syntax errors –These are errors reported by the compiler/interprete­r when the rules of the language are not obeyed. (An example of this

was shown for the explanatio­n of a bug).

10. Logical errors – These errors occur when the expected results of a program are not met.

11. Testing – This is the process of checking a program for errors. This involves running and compiling the program, where a feedback will be provided by the translator.

12. Debugging – This is the process of testing, locating and correcting mistakes by running the program.

13. Linking – This is combining various pieces of code and data to form a single executable object code that can be loaded in memory. Linking can be done at compile time, at load time, and also at runtime.

14. Compiling – This is used for converting a program into a machine code or lower-level form in which the program can be executed.

15. Executing/run – This is the process by which a computer performs the instructio­ns of a computer program.

16. Desk checking – Tracing involves executing the program manually by using values for variables and recording what takes place after each instructio­n is executed.

17. Program listing – This is a printout or soft copy of the source program instructio­ns as a reference while working and coding the program.

We have come to the end of this lesson. See you next week when we will look at some key programing terms and the Pascal language. Remember, if you fail to prepare, you prepare to fail.

 ??  ??

Newspapers in English

Newspapers from Jamaica