Do Mime Nos

Click here to load reader

download Do Mime Nos

of 42

  • date post

    27-Apr-2015
  • Category

    Documents

  • view

    34
  • download

    1

Embed Size (px)

Transcript of Do Mime Nos

'

. 130 . , . . .

1 2 , - , , . . , , , . . , (1 20) . . , . , , . . , .

3 . : ,

4 , . . . : : . : , .

5 , , , . : ' . . ,

. . . (). HIPO (Hierarchical Input Processing Output), . . , .

6 . : . : . () . : ,

7 ,

:

0 1 (.. 00011001100) . . . ( ) , (.. V), (). ' . . . 3 (.. print, write, repeat) . , . .

: , : : FORTRAN, C, APL : COBOL, RPG : BASIC, LOGO : LISP, PROLOG : PL-1, PASCAL

4 . 3 . , . . . (DBMS). ' .

, . . , , , . , . , .

. , . , . . . . (, ). . , - . -.

, , . , .. PASCAL. . ( )

: Compiler ( ) Interpreter (, ) Compiler , .

Compiler: Interpreter , . interpreter compiler : - ()

(editor) (source). - . , . Compiler (linker) . : compiler - (loader) : . , . Linker

8 PASCAL PASCAL : (pointer) (compound statement), ( begin end).

, . (Syntax) . (Semantics) . (Data Type) .

. . . (integer) (real) (boolean) (char)

(string)

(integer) . :

shortint -128 127 (1 byte)

integer -32768 32767 (2 byte) longint -2148483648 2147483647 (4 byte) byte 0 255 (1 byte) word 0 65535 (2 byte) + * / div mod

:

7 div 3 = 2 7 mod 3 = 1

(real) : real (6 byte) single (4 byte) double (8 byte) extended (10 byte) comp (8 byte) + * /

:

: T : *, /, DIV, MOD : +, (*, /, DIV, MOD) (+, -) : 8 * 3 + 6 / 3 = 24 + 2 = 26 3 + 6 DIV 2 6 6 MOD 4 = 3 + 3 6 2 = -2 , : 3 * 8 / 2 DIV 3 MOD 3 = 1 : 8 * (3 + 6) / 3 = 8 * 9 / 3 = 24

(boolean)

, True () False (). : and or xor not True True False False True False True False A and True False False False A or B True True True False A xor B False True True False Not A False False True True

, .. A > B a = 5 a < 13 True False, , . : (a > 3) and (b > 10) or (c < 20) (Hlikia >= 18) and (fylo = '') : T : and ( ) : or, xor ( ) .. : a = 5, b= 8, c = 15: (a > 3) and (b > 10) or (c < 20) True and False or True -------------------False or True ----------------------True .

(char)

, ASCII.

: '', '', 'J', 'U', 'a', 'c', '', '', '', '', '1', '2', '9', '&', '/', ')', '%'. ( ) , (compiler) .

(string)

, : '' ' 55' '81400' . , . 255 .

PASCAL : ... program proion;{} uses wincrt; { } const fpa=20; { } var timi,teliki:real; { (/) } procedure diavasetimi(var t:real); begin write(' : '); readln(t); end; { } begin diavasetimi(timi); teliki:=timi+timi*fpa/100; write(' : ',teliki); end;

9 , write writeln . write, .: write(''); , ('') . : ! program kosmos; { } uses wincrt; { } begin write(' !'); { } end. ! . () . . compiler . var (begin) . : program kosmos; uses wincrt; var minima:string; begin minima:=' write(minima); end. ! := = : a := 2 a := 'hello' a := b

{ } !'; { } { }

a := (b + 2/3) + 50 . : ! . program kosmos; uses wincrt; begin write(' !'); write(' '); end. !

. writeln. . : program kosmos; uses wincrt; begin writeln(' !'); { } write(' '); end. ! :

:

read readln . read : read(a); ( enter), a. . program geia_xara; uses wincrt; var onoma:string; begin writeln(' ;'); read(onoma); write(' ',onoma); end. ; 'Enter'

; ,

;

' ' onoma. , . .

,

.

() () . . program geia_xara; uses wincrt; var onoma:string; ilikia:integer; begin writeln(' '); read(onoma,ilikia); write(' ',onoma,' ',ilikia,' '); end. ' } 18 18 read readln. . : read(a,b,c); read(d,e); : 15 16 28 33 23 45 : a=15 b=16 c=28 d=33 e=23 readln: readln(a,b,c); readln(d,e); : a=15 b=16 c=28 d=23 e=45 readln , , read . readln 'Enter', , . 4 ( 33) , read d .

10 if then if then . . if then. . program enilikos; uses wincrt; var onoma:string; ilikia:integer; begin writeln(' '); read(onoma,ilikia); if ilikia >= 18 then write(' ',onoma,' '); end. 18

, >= 18 ,,

,

>=18 . . 17 , ,

, else: program enilikos; uses wincrt; var onoma:string; ilikia:integer; begin writeln(' '); read(onoma,ilikia); if ilikia >= 18 then write(' ',onoma,' ') else write(' ',onoma,' ') end. 17

, >= 18 ,, ,,

,

>=18

, ,

, ,

:

: 70 70 program ekloges; uses wincrt; var ilikia:integer; begin writeln(' '); read(ilikia); if ilikia < 18 then write(' ') else if (ilikia >= 18) and (ilikia = 18