Basic Pascal Program

02.13 Edit This 0 Comments »
Elements of Programming

a. Getting the data by reading data from the default input (key board, files or other data sources).
b. Storing data into memory with the appropriate data structure,
c. Process data with precise instructions.
d. Present or send the processed data to default output (monitor, file or other purposes.)

Du names used in the Pascal program called the rated or Identifier. Identifier used to name: Program, Sub-programs (procedures and functions), name: Variable, Constant, Type, Label.
These names are used for consumption and callings in the program. Terms of writing identifier
a. Identifier name must begin with the alphabet characters: a through z, A to Z or the character '_' (underscore - a line below)
b. The next character numeric characters allowed (0 .. 9) or a combination of alphanumeric (letter-numeric).
c. Long name, in various versions of Pascal is generally between 32-63.
d. May not use special characters: + - * / | \ = <> []. ,;: () ^ @ {} $ # ~! % & `" 'And? Examples of writing:
Writing right: NamaMahasiswa, Gaji_Karyawan, PX4, etc..
Writing wrong: 3X, A & B, C, Z, etc..

Variable is an identifier that contains data that can change its value in the program. Variable declarations are:
a. Provide a variable name as the identity identifier
b. Determine the data type variables
Examples of variable declarations: var X: integer;
R: real;
C: char;
Q: boolean;
The constant is an identifier that contains the data whose value does not change in the program.
Constant declarations are:
a. Provide constant names as identity recognition
b. Determining the constant value
Examples of constant declarations: conts maxsize = 100; {integer}
ExitC = 'Q'; {char}

Reserved Words or reserve words in Pascal are words that have been defined by Pascal who have maksdu tertentu.Suatu Unit is a collection of constants, data types, variables, procedures and functions. Unit standards in Pascal which can be directly used is System, Crt, Dos Printer, and Graph. To use a unit, then we must put clausa or the Uses clause in the initial block of the program, followed by a list of units used. On this matter to be discussed is the Crt unit. This unit is used to manipulate the text screen (windowing, laying the cursor on the screen, color text, extended keyboard codes and so forth.

Bahasa pemrograman

Programming language, or often termed also with computer language, is the technique of command / instruction standards to govern the computer. This programming language is a set of rules of syntax and semantics used to define computer programs. This language allows a programmer to specify exactly which datawill be processed by the computer ,how this data will be stored / transmitted ,and precisely what kind of steps to be taken in various situations .

According to the level of proximity to the engine computer, programming language consists of:

1. Language Engine, which gives orders to the computer by using the binary language code, for example 01100101100110
2. Low Level Languages​​, or known as assembly language (bah.Inggris Assembly), which gives orders to the computer by using short codes (mnemonic codes), for example, MOV, SUB, CMP, JMP, JGE, JL, LOOP, etc..
3. Language Secondary Level, which is a computer language that uses a mixture of instruction in the words of human language (see examples Languages ​​High Level below) and instructions that are symbolic, for example, {,},?, <<,>, & &, | |, etc..
4. High Level Language, which is a computer language that uses the instruction coming from elements of human language words, for example, begin, end, if, for, while, and, or, etc..

Most programming languages ​​are classified as high-level language, only C language which is classified as High Level Language and Assembly Language Level is Low.

0 komentar: