Results (
English) 2:
[Copy]Copied!
1.3. The interpreter and compiler
All programs are written in the language is not the ultimate machine language must be converted into machine language before being executed. High-level language program is translated into machine language in one of two ways: by the compiler (compiler) or interpreter (interpreter).
Compilers:
Will convert the entire program into machine code, and then into the bowl containing the results in order to implement later. High-level language program is converted is called the source program (source program) and machine language program was created called program object (object program) or object code (object code). When users want to run the program, object program will be loaded onto the main memory of the CPU and the directives of the program will be executed. When guided by the directives of the program, the CPU will access the data and generate results. The compiler will check the syntax of the program, perform logical tests and ensure the data is going to be used in the comparison, calculations were reasonably defined in somewhere in program. Another important function of the compiler is that it will generate a list of all propositions error in the program violates the syntax of the language. This list helps programmers easily modified program.
Due to machine language depends on the processor so different computers will require different compilers for the same high-level language. For example, a mainframe, minicomputers and personal computers require different compilers to compile the same source programs into machine code for each type of machine.
Interpreter:
Instead of converting the entire program sources such as the compiler, the interpreter only convert a clause of the program and the implementation code immediate results, then it continues to convert the 2nd clause then implement the results of the 2nd code and so on. When using the interpreter, each running program is each source programs are translated into machine language. No program object is created.
The interpreter is often used on the personal computer does not have enough memory or computing power needed to use the compiler. The advantage of the interpreter that programmers can still run a program still syntax error. Only time interpreter to command syntax errors, the process of implementation of the new program is stopped and the interpreter will error. The disadvantage is that the program does not run as fast interpreter programs compiled for the transition into machine language is done with the process of implementation of the program. For this reason, today, the majority of high-level language compiler used.
1.4. Structured programming
structured programming is a programming method has the following basic characteristics: simplicity can, structural control and input / output unit. Adhere to the principle of structured programming will help the program easy to write, easy to read, easy to understand, easy to control and easy calibration error.
Simplicity can (modules):
With structured programming, problems in programmable decay (split) into smaller parts called the single can. Each unit, known as a subroutine in the programming language, will perform a predetermined task in the program. Score major advantage of this technique is that it simplifies the development of application programs for each program can be developed independently. When the unit can be assembled, they form a complete program to create the desired result.
Diagram structure (chart), also known as hierarchical diagram (hierarchy chart) is commonly used to decompose and be represented for the program menu. When a program decay process is complete, the entire structure of the program will be performed by a hierarchical diagram. Here is an example:
The structure controls (control structure):
In structured programming, it uses three control structure to create the logic of the program. All problems can be solved logically be coordinated by this structure 3. 3 structures are: Sequential structure (sequence), the structure chosen (selection) and structured loop (iteration).
Sequential structure: in this structure, the processes are performed in sequence, from the process to the process of following it.
Structure Selection: also known as the structure if ... then ... back again (if ... .then ... else) that allows programmers to express the conditions in the program logic. The significance of this structure is that if the conditions are right, the implementation process with strict conditions, in contrast, performs with the wrong conditions. it uses three control structure to create the program's logic. All problems can be solved logically be coordinated by this structure 3. 3 structures are: Sequential structure (sequence), the structure chosen (selection) and structured loop (iteration). Sequential structure: in this structure, the processes are performed in sequence, from the process to the process of following it. Structure Selection: also known as the structure if ... then ... back again (if ... .then ... else) that allows programmers to express the conditions in the program logic. The significance of this structure is that if the conditions are right, the implementation process with strict conditions, in contrast, performs with the wrong conditions. it uses three control structure to create the program's logic. All problems can be solved logically be coordinated by this structure 3. 3 structures are: Sequential structure (sequence), the structure chosen (selection) and structured loop (iteration). Sequential structure: in this structure, the processes are performed in sequence, from the process to the process of following it. Structure Selection: also known as the structure if ... then ... back again (if ... .then ... else) that allows programmers to express the conditions in the program logic. The significance of this structure is that if the conditions are right, the implementation process with strict conditions, in contrast, performs with the wrong conditions. selected structures (selection) and structured loop (iteration). Sequential structure: in this structure, the processes are performed in sequence, from the process to the process of following it. Structure Selection: also known as the structure if ... then ... back again (if ... .then ... else) that allows programmers to express the conditions in the program logic. The significance of this structure is that if the conditions are right, the implementation process with strict conditions, in contrast, performs with the wrong conditions. selected structures (selection) and structured loop (iteration). Sequential structure: in this structure, the processes are performed in sequence, from the process to the process of following it. Structure Selection: also known as the structure if ... then ... back again (if ... .then ... else) that allows programmers to express the conditions in the program logic. The significance of this structure is that if the conditions are right, the implementation process with strict conditions, in contrast, performs with the wrong conditions. then ... else) that allows programmers to express the conditions in the program logic. The significance of this structure is that if the conditions are right, the implementation process with strict conditions, in contrast, performs with the wrong conditions. then ... else) that allows programmers to express the conditions in the program logic. The significance of this structure is that if the conditions are right, the implementation process with strict conditions, in contrast, performs with the wrong conditions.
Being translated, please wait..
