Chapter 7 computer language. Computer language • Computer language refers to the language of symbols, innovative development of the set to take the place of communication between human beings with the command/computer. • What kind of computer language. Divide into 5 categories. 1. the machine language. -A low level language. -Use the numbers 0 and 1 as the machine language that the computer understands directly do not need to have a translator. -A program written in machine language, can be used with computers that use only the program development. 2. Assembly language. Also known as "sign language" is a low-level language. -Use as a language of instruction instead of a short command. The new code, such as the so-called new wamo. A replacement additive (Add) C instead of comparison (Compare) Multiplication (Multiply) MP instead. Instead of storing information on the STO memory (Store) -The need to translate the translation program called mabelo (Assembler), which the Assembly will translate the source program (Source code) written in Assembly language to machine language. 3. high level languages. -Use the English word instead of code instructions The language of the procedure-a layer -Development of a high level language programs. Need to make a translation of the original program commands (Source code) that is written in a high-level language into machine language. High level language, such as, for example-the basic language of Paschal II Fortran COBOL, c language, etc. 4. very high level languages. -Use the English word instead of commands, tasks, as well as a high level language. -As is the procedure covering. -Write simple and convenient high level languages. For example, language such as SQL language-used in the database, etc. A very high level, do not-language was designed to be able to work alone to work with other languages. 5. natural language. -Natural language is not interested in the format command, or the regulators. -The user can type in a word or a sentence in which a computer user to understand. The computer will attempt to translate a word or sentence to follow the command. -Language naturalist job application system specialist Language translator. Refers to a program that performs translation of the original program (Source code) written as a binary number as to make the computer work. Type of translation -The Assembly language program translate mabelo (Assembler). -The translation program, the compiler (Compiler). -The Internet English translations Terminal (Interpreter). Assembler Language-specific translation is assembly language. Compiler -Translation of the original program, written from a high-level language to an object (Object Code). Object code can be applied immediately. -During the translation. If you encounter an error that caused the write command displays an error and stops translating when an error occurred during translation. The author of the program will be required to edit and translate again. -For example, FORTRAN compiler: language, PASCAL, C, C ++, etc. Interpreter -Translation of the original program, written from a high-level language into machine language. -Translation of the Source code one at a time, as the Object code. -If an error is found, it will stop working and to fix the wrong command started a new processor. -Example: BASIC language Interpreter languages, etc. Object-oriented programming. -Key features of OOP is hiding (Encapsulation), inheritance (Inheritance) and agree on the format. -A computer language used to write OOP: Java (JAVA), C ++ language, Smalltalk etc. Chapter 8 programming structure The principles of effective programming. •-The logic • Easy to understand reading • Non-segmented complex. There are 2 programming. -A modular programming. Module (Module) is a very small program (Subroutine), which can be run as an independent has 2 sub programs inside and outside the sub program. -A top-down programming. Look at the issue with an emphasis on functional structure overview using the chart of the structure (Structure Chart) on a work schedule defining primary module to start. Call a sub module and end processing order is not highlighted. The infrastructure that is used to write the program. Is the structure shows that the procedure is based on the priority and each step is processed only once. Unable to show the work of this structure. Algorithm 1. start. 2. configure the payment amount (Price) is equal to zero. 3. stock information (Amt) and the price (Cost). 4. calculate the amount paid from the Amt Cost Price = x. 5. display. The amount that must be paid. 6. exit. Pseudocode (Pseudo Code). Begin Price = 0 Read Amt, Cost Price = Amt x Cost Write Price End Structure of the selection (Selection Structure). The conditions that must be decided is the work results of the condition is true or false only. The type of the selected structure 1. Select the run only when a condition is true. Pseudocode IF............... THEN (A command) ... For example, the program displays the result on the screen. Algorithm 1. start. 2. pick up test scores (Score) 3. If the exam score 50 points or more, print screen ' You pass '. 4. exit. Pseudocode (Pseudo Code). Begin Read Score IF Score >= 50 THEN Write 'You pass' End 2. Select one of the real and the false condition during. Pseudocode (Instruction B) ..... THEN ..... ELSE (commands A) ..... ... 3. Select the nested command. Algorithm 1. start. 2. get c.
การแปล กรุณารอสักครู่..