Rabu, 05 November 2008

PASCAL IANGUAGE STRUCTURE RECOGNITION

Elementary Interest:
1. Student recognize and comprehend Ianguage structure Pascal
Indicator:
1. Student able to differentiate structure component Pascal Ianguage
2. Student able to make program with Ianguage Pascal
3. Application Student a or algorithm flowchart to Pascal.
A. the THEORY BASE
1. Scheme from Pascal program shall be as follows:
Program name_program.
[Lable declaration ]
[ Declaration Konstanta]
[ Type Declaration]
[ Variable Declaration ]
[ Declaration Subprogram ]
Begin
Statement ;
....
Statement;
End

2. Variable
Variable (changer) represent an name implying computer memory location which can used for saving assess, where its contents earn diubah-ubah. Variable can be looked into as abstraksi from location. result Abstraksi from variable is value from that variable. Assess from an variable altered by assignment statement. A assignment statement composed from a its his left variable begin and an expression on the right.
Sum up := B1 + B2
variable sum up altered by its value become value from expression B1 + B2 after evaluated. In an Pascal program of each every variable to be used beforehanddeclaration, where each;every variable have tohaving type. Variable declaration of good forgiving information to compiler and also assistprogrammer thinking clearly and planer.

Var
B1, B2, sum up : integer

3 Type / Type of Data
When a declaration variable hence its type is at one blow determined. Type from anvariable express
a. Value type which can be kept in location memory for the the variable, ( limiting values gathering which can be had the variable)
b. Operation type which can be done to pertinent variable
4. Statement
Statement is consecution of instruction to be executed by computer. Statement in Ianguage Pascal consisted of by two kinds of, that is a. Simple Statement that is statement which
1) Assignment Statement that is statement what is used assign value to an
variable. Follow the example of :
a:=10;
b:=a*2;
2) Statement used to call
procedure or function. Follow the example of :
calculate (a,b);
print ( a,b)
3) Jump Statement that is declaration used to skip statement other
b. statement Majemuk ( Compound Statement).
In Pascal Ianguage, statement majemuk early by begin and terminated by end.
B. GUIDE PRAKTIKUM
Type 2 listing program in the following is:
1. Program 1.1 ( prog_1_1.pas) : Kenalan, Ask Your age and name.
program kenalan;
uses wincrt;
var name: string;
age: integer;
Begin
writeln('program kenalan');
writeln(‘will ask your age and name');
write(' typing of your name '); readln(name);
write(' how much of your age ( th) '); readln(age);
writeln('name = ', name);
writeln(age ( day = ', age*365);
readln;
2. Program 1.2 ( prog_1_2.pas) : Quantifying two integer.
program sum up number;
uses wincrt;
var a,b sum : integer;
Begin
writeln('program count two number circular');
written(number 1 '); readln(a);
write(' number 2 '); readln(b);
sum up := a+b;
write('sum two number ');
write(sum);
readln;
end.
C. the Ambit 1. Scheme from program of Pascal shall be as follows:
Program name_program;
[ Lable declaration]
[ Declaration Konstanta]
[ Type Declaration]
[ Variable Declaration]
[ Declaration Subprogram ]
Begin
Statement
....
Statement;
End
2. Variable
representing a[n name implying location
memory of computer which can be used for
saving assess, where its contents earn diubah-ubah
3. Type / data type
Representing declaration of variable mentioned before playing the program so that earn menyimpan value matching with type of data mentioned.
4. Statement
Representing consecution of instruction to be executed
by computer.

Tidak ada komentar: