Page 17 - CA_Blue( J )_Class9
P. 17

Fifth generation languages (5GL)
                 The fifth generation languages, also known as natural languages, are the programming languages that have visual
                 tools to develop a program. Examples of fifth generation languages, include Mercury, OPS5, and Prolog. Natural
                 language is very easy to use.

                 Natural languages are often associated with expert system and artificial intelligence and are considered easy to
                 use. These systems are popular in the medical and scientific fields, but are not widely used in business applications.
                 For example, if a program is written in 4GL to get the names of students whose marks exceed 95, it might be
                 written as:

                    SELECT LAST_NAME, FIRST_NAME FROM STUDENT WHERE MARKS > 95;
                 A natural language version of the same program might be written as:

                    TELL ME THE NAME OF STUDENTS WITH MARKS OVER 95.
                 Advantages of High-Level Languages
                 •  High-level languages are user-friendly.
                 •  High-level languages are similar to English, making them easier to use.
                 •  High-level languages require less time to code.
                 •  High-level languages are easier to maintain.
                 •  High-level languages are problem-oriented.
                 •  Programs written in high-level languages can be translated into machine language and therefore can run on
                    any computer with an appropriate translator.
                 •  They are independent of the machine on which they are used and can be executed on any computer.
                 Disadvantages of High-Level Languages
                 •  A high-level language has to be translated into the machine language by a translator and thus it wastes a lot of
                    the computer time.
                 •  The object code generated by a translator might be inefficient as compared to an equivalent assembly language
                    program.

                 1.1.4 Comparison between Three Types of Computer Languages
                         Machine Language                 Assembly Language                High-Level language

                  Uses binary digits for coding     Uses mnemonics for coding        Uses  English,  like  language  and
                                                                                     symbols for coding.

                  Directly understood by Computer   Assembler  is required to convert  Compiler is used to convert codes
                                                    codes to machine language.       to machine language
                  Example: character ‘A’ is represented  Example: to execute  addition,  it  Example: for adding two numbers
                  as 01100001                       uses the symbol ‘Add’            10 and 20

                                                    Add A B                          int s=a + b;

                 1.1.5 Source Code and Object Code
                 The program written by a programmer in a text editor, which is later converted to machine language using a
                 compiler or interpreter is called the source code. It is also known as source program. The program converted in
                 machine language is called object code. It is also known as object program.

                 Compiler
                 A compiler is a translator program that converts the entire source code (high-level language program) into object
                 code (machine language) at once. It displays the errors for the whole program together.


                                                                          Principles of Object-Oriented Programming  15
   12   13   14   15   16   17   18   19   20   21   22