# MAIN BODY OF PROGRAM DECLARATION ACTION

## Presentation on theme: "MAIN BODY OF PROGRAM DECLARATION ACTION"— Presentation transcript:

MAIN BODY OF PROGRAM DECLARATION ACTION
PASCAL PROGRAMMING MAIN BODY OF PROGRAM DECLARATION ACTION

DECLARATIONS CONST TYPE VAR PROCEDURE FUNCTION

EXAMPLE Program Example; uses dos,crt; const A = 10; Book = ‘Kitap’;
Good = true; Bad = false; MsgHelp =‘Yardım için F1 tuşu’; Days : array[1..7] of String[5] = (‘Mon’, ‘Tues’,’Wed’,’Thurs’,’Fri’,’Sat’,’Sun’);

type Isimler = array[1..100] of String[20]; Names = Isimler; SurNames = Isimler; Name = String[20]; ArrayValues = array[1..500] of Real; Student = Record Isim : Name; Soyad : Name; Age : Integer; end;

var Talebeler : Isimler; x,y : ArrayValues; B : array[1..200] of real;
k : Notlar; B : array[1..200] of real; C : array[1..10] of char; Kelime : String[20];

program Alan; var A : Real; I : Integer; procedure ComputeArea(x,y:Real ; var Area : Real ; var N : Integer); begin Writeln(‘How many significant digits after decimal ?’); Read(N); Area := x * y; end; ComputeArea(5,5,A,I); Writeln(‘Area = ‘,A:3:I); end.

program Alan; var A : Real; I : Integer; procedure ComputeArea(x,y:Real); begin Writeln(‘How many significant digits after decimal ?’); Read(I); A := x * y; end; ComputeArea(5,5); Writeln(‘Area = ‘,A:3:I); end.

program Alan; uses unit1; begin ComputeArea(5,5); Writeln(‘Area = ‘,A:3:I); end.

unit unit1; interface var A : Real; I : Integer; procedure ComputeArea(x,y:Real); implementation procedure ComputeArea; begin Writeln(‘How many significant digits after decimal ?’); Read(I); A := x * y; end; end.

STATEMENTS SIMPLE STATEMENTS X := y * z + w/v -u; Name := ‘Demir’;
STRUCTURED STATEMENTS SIMPLE STATEMENTS X := y * z + w/v -u; Name := ‘Demir’; Sentence := ‘ This is a sentence’; BunuYaz(‘This is a sentence’); Satir := Line(1);

STRUCTURED STATEMENTS
IF <boolean expression> then begin statement1; statement2; true . end else statements; false end;

STRUCTURED STATEMENTS
case <ennumerated expression> of {case 1} : begin end; {case2} : begin end else begin

while <bolean expression> do
begin end; repeat until <boolean expression>;

for I :=n to m do begin end; this can also be from m to n where m>n