Download presentation
Presentation is loading. Please wait.
1
Paskal Dil Karşılaştırması
Aslı Ergün
2
Veri Türleri Pseudocode Pascal/Delphi C++ Integer Floating point
Boolean Character String Single, Real, Double Char int, long float, double bool char string -2,147,483,648 to 2,147,483,647 (4 byte) 5.0 x 10^-324 to 1.7 x 10^308 (8 byte) True/False (1 bit) ASCII karakter, 1 byte
3
Veri Türleri var a: char; text1: string;
c: Real; // c: Single; veya c: Double; d: Boolean; Year: Integer; begin a := 'H'; text1 := 'Hello World!'; c := 4.5; d := True; Year := 2017; end
4
Fonksiyon Tanımlama Pseudocode Pascal/Delphi C++ Name Statement/s END
PROCEDURE Name(parameter if any); BEGIN Statement/s ; END; FUNCTION Name(parameter if any): datatype; statement/s; Name := returnValue; or RESULT := returnValue; void Name(parameter if any); { } ; datatype Name(parameter if any) return value; };
5
Değişken ve Sabit Tanımlama
Pseudocode Pascal/Delphi C++ Variable Declaration VAR variableName1,...:datatype; datatype variableName1, ... ; CONSTNAME = value CONST CONSTNAME = value; const datatype CONSTNAME = value;
6
Değer Atama Pseudocode Pascal/Delphi C++ SET variableName TO value or
variableName = value variableName := value ; variableName = value ;
7
Mantık Operatörleri Pseudocode Pascal/Delphi C++ operand = operand
operand NOT = operand operand < operand operand > operand operand <= operand (operand = operand) (operand <> operand) (operand < operand) (operand > operand) (operand <= operand) (operand == operand) (operand != operand)
8
Mantık bağlaçları Pseudocode Pascal/Delphi C++ operand AND operand
operand OR operand operand NOT operand NOT (operand) (operand && operand) (operand || operand) ! (operand)
9
IF ELSE karar yapısı Pseudocode Pascal/Delphi C++ IF (condition) THEN
True statement/s block ELSE False statement/s block ENDIF BEGIN True statement/s block; END False statement/s block; END; if (condition) { } else };
10
Switch karar yapısı Pseudocode Pascal/Delphi C++
CASE OF single_variable value_1 : statement block_1 value_2 : statement block_2 ... value_n : statement block_n ...... value_other : statement block_other ENDCASE CASE single_variable OF value_1 : statement block_1; value_2 : statement block_2; value_n : statement block_n; ELSE statement block_other; END; SWITCH (single_variable) { case value_1 : statement/s ; break; case value_2 : statement/s; case value_n : statement/s; default: statement/s; };
11
DO WHILE döngüsü Pseudocode Pascal/Delphi C++ DO statement/s
WHILE (condition) REPEAT statement/s; UNTIL NOT (condition); do { } while (condition); DOWHILE (condition) ENDDO WHILE (condition) DO BEGIN END; while (condition) };
12
Repeat döngüsü Pseudocode Pascal/Delphi C++ REPEAT statement/s
UNTIL (condition) statement/s; UNTIL (condition); do { } while !(condition);
13
FOR döngüsü Pseudocode Pascal/Delphi C++
DO counter = begin TO end statement/s ENDDO FOR counter := begin TO end DO BEGIN statement/s; END; for (counter = begin; counter <= end; counter++) { };
14
Kayıtlar(Records) Pseudocode Pascal/Delphi C++ Record structures
recordName fieldname1 fieldname2 ... fieldnameN TYPE recordName = RECORD field1 : datatype; field2 : datatype; .... fieldN: datatype; END; struct recordNameType { datatype field1; datatype field2; datatype fieldN; };
15
Diziler(Arrays) Pseudocode Pascal/Delphi C++ Declaring arrays
One-dimensional SET arrayName(maxNumElements) VAR arrayName : ARRAY[begin .. end] OF datatype; datatype arrayName [maxNumElements]; Two-dimensional SET arrayName (row, column) arrayName : ARRAY[begin ..maxrow, begin..maxcolumn] OF datatype; [row][columns]; Processing Array Elements Assigning a value arrayName (index) = value Reading a value variableName = arrayName (index) arrayName [index] := value; variableName := arrayName [index]; arrayName [index] = value ; variableName = arrayName [index];
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.