.


:




:

































 

 

 

 


IV. . Turbo Pascal




 

PASCAL, (1623-1662), 1968 1971 ͳ ³ ().

Pascal . ³, Turbo Pascal Borland International ()  . Turbo Pascal , . , , - Turbo Pascal.

: Turbo Pascal ( , MS DOS), Borland Pascal (ᒺ- , MS DOS), FreePascal (32- ), Object Pascal Delphi ( MS Windows), - .

 

 

- , ().

:

 

( ),

( , , ),

( ),

( ),

( '),

( ).

, .

 

Turbo Pascal () turbo.exe. . ³ 1 9. 9 . , ( ):

 

 

F10. :

File. 䳿 (, , .)

Edit. (, , , .)

Search. .

Run. , .

Compile. .

Debug. ̳ , ().

Tools. ̳ Turbo Pascal.

Window. (, , , ).

Help. .

( ) ( ). :

 

F1
Ctrl+F1 ,
F10
F2
F3
Alt+F3
Alt+
Alt+F9
Ctrl+F9 ,
Alt+F5
Alt+X
Shift+ à Shift+ ß Shift+ á Shift+ â
Ctrl+Insert
Shift+Insert ﳿ

 

Turbo Pascal:

 

 

(. ) .

 

(, F2).

 

ϳ (, Alt+F9).

, , .

 

(, Ctrl+F9).

 

( ) Alt+F5.

 

(, Alt+X).

. , , , ( ). : (, ), ( Turbo Pascal , tpc.exe) ( Turbo Pascal turbo.tpl), ( ). , .

 

 

1. Pascal .

2. Pascal.

3. ?

4. ?

5. Turbo Pascal?

6. 䳿 ?

7. ?

8. ?

9. , , , ?

10. ?

11. ?

12. ? ?

13. ?

14. EXE-?

15. ' IDE?


1 . ˲Ͳ . /.

 

 

. - . ͳ ³, Pascal, :

+=.

 

, Turbo Pascal, :

* ( );

* ;

* ( , , , );

* ( (), , , , , );

* , begin end.

 

:

program _ ;

program main;

uses , ;

uses crt, dos, graph;

label ;

label m1, m2, , mn;

const ;

const c1=_1; c2=_2;

type ;

type t1=__1; t2=__2;

var ;

var v1: _1; v2: _2;

begin

;

end.

m1, m2, , mn - ; c1, c2, - ; t1, t2, - ; v1, v2, - . .

: ; Turbo Pascal , .

, - , - .

Turbo Pascal 10 :

1. ,

2. ,

3. ,

4. ,

5. ,

6. ,

7. ,

8. ,

9. ,

10. .

: 2, 3, 4, 5, 6, 7, 8.

(, , 4 - 10), ( , 1 - 3).

Ϊ ( ). : x:=0. 785398 ; b:=c/a+1; n:=x;

, :=, , :=. , , ᒺ, , , .

. Turbo Pascal , , . ³ , , : read(x1,x2,y); write(x,y,x+y,x-y);

read - , - ; write - , - , , , . .

, .

. : , .

:

write(x:4); - 4 , x,

write(x+y:12:5); - 12 , 5 - , x.

/ readln writeln. 䳿 , EOL (End Of Line) /. .

. , .

( ) ( ). . Turbo Pascal , , , .

Integer - Byte, Shortint, Word, Longint Real - , Single, Double, Extended, Comp.

ᒺ :

ij
Integer -32768..32767 2 byte
Byte 0..255 1 byte
Shortint -128..127 1 byte
Word 0..65535 2 byte
Longint -2147483648..2147483647 4 byte
Real 2.9E-39..1.7E38 6 byte
Single 1.5E-45..3.4E38 4 byte
Double 5.0E-324..1.7E308 8 byte
Extended 3.4E-4932..1.1E4932 10 byte
Comp 64-bit integer 9.2E18..9.2E18 8 byte
Char ASCII 1 byte
Boolean True, False 1 byte

 

, :

:= .

:= , , (, real integer, integer word, longint integer, string char).

 

, system ( - , uses system;) Turbo Pascal 7.0 :

Abs() - ,

Sqr() - ,

Sqrt() - ,

Exp() - ,

Ln() - ,

Sin() - ,

Cos() - ,

Arctan() - ,

Odd() - ,

Int() - ,

Round() - ,

Trunc() - ,

Frac() - .

: xy exp(y*ln(x)). .

 

³ . .

1) ³ a, b, c . Sa Sg .

2) n :

 

,

3) :

 
 

 

 


4) : a, b, c, Sa, Sg .

5) :

Program p1;

var a,b,c, Sa,Sg: real;

Begin

writeln(' ');

Readln(a,b,c);

Sa:=(a+b+c)/3;

Sg:=exp(ln(a*b*c)/3));

writeln('Sa = ',Sa:8:4);

writeln('Sg = ',Sg:8:4);

End.

6) :

a =1 b =2 c =4

Sa =2.3333 Sg =2.0000

7) :

Sa = 3.0000

Sg = 3.0000

 

1. , Hb =4000 . - ; a =8% - .

2. 41943040 , , .

3. , Ya =40% - ; B =10650 . - ; Bm =4242 . - , .

4. , ( ). , .

5. ( ), , 1 %, 2 % 3 % .

6. ϳ . %. .

7. . , 1 . , S , N /.

8. , 1, 2, 3.

9. ³ (X0,Y0,Z0) B(X1,Y1,Z1). .

10. ABCD A . B D.

11. , % . ?

12. , =268 . . - ; =105% - ; =3,5% - .

13. , . .

14. 㳿 , 0 =268 . .; 1 =351 . . - 㳿; 0 =98 . . - ; 0 =0,89 ., 1 =0,71 . - 1 . 㳿.

15. 㳿 , I =1958 . - ; I =456 . - 㳿; Ig =36 . - 㳿; Vi =26 . - 㳿; V =12 . - 㳿.

16. y=sin(x) [0, 1.5] y=x-x3/6+x5/120. x y , Sin.

17. - , =98 . - ; 1=4,5%, 2=0,5% - 쳿 ; =8 - .

18. - , 1=13 ., 2=98 . - - ; 1=1286 . - ; 2=6986 . - .

19. , 1=156 . . - ; 2=1286 . . - ; =938 . . - .

20. , =56,38 . - ; =27,25 . - .

21. , . .

22. , m =32,6 . . - , ; =56,6 . . - , ; =128,4 . . - , .

23. ³ , : y=k1*x+b1, y=k2*x+b2. ( ) , .

24. n m . x ., y % . .

25. (1 ≈ 2.54 ). , , .

 

 

1. Turbo Pascal?

2. ?

3. ?

4. ?

5. ?

6. ?

7. ?

8. ? Turbo Pascal?

9. ?

10. ?

11. ?

12. () , ?


2 ί

 

. ( ), ( ), .

 

goto n; n - , ( ).

: , ( 㳿 ), .

- , begin end. , ᒺ .

: begin end; ( ).

, . ³ :

if _ then ;

True, ( ), ( ), ( , ) if .

if _ then _1 else _2;

True, _1, _2. ϳ if .

( ) ( , not - , and - [ , ], or - ' [ , ]), . = (), <> ( ), > (), < (), <= ( ), >= ( ).

: .

. ³ :

case _ of

__1: _1;

__n: _n;

Else

End.

_ __1,

_1;

_ __2,

_2;

;

_ _,

.

: case - of () _ - ( ').

 

p q , p q .

 

1) ³ p q.

2) p q, p q 0.

3) :

 
 

 

 


4) : p, q, c ( ) - .

5) :

Program p2;

var p,q,c: integer;

Begin

writeln(' ');

Readln(p,q);

c:=p mod q;

if c=0 then writeln(' ',p,' ',q)

else writeln(' ',p,' ',q,' ',c);

Readln

End.

6) :

) p=4 q=2 4 2

) p=7 q=2 7 2 1

7) :

34 15

34 15 4

1. S , T - , t - , .

2. F x .

3. ³ n -. , ' .

4. :

<17.00 ., =0;

17.01 85.00 ., = 10% , 17.00 .;

85.01 170.00 ., = 6.80 . + 15% , 85.00 .;

170.01 1020.00 ., = 19.55 . + 20% , 170.00 .;

1020.01 1700.00 ., = 189.55 . + 30% , 1020.00 .;

> 1700.00 ., = 393.55 . + 40% , 1700.00 ., - .

5. ( ) ( ). .

6. z - (.), k - , b - (), c - ().

7. : 0,5 . 1,25 . Ӫ (1) (2), ( ), (, , ).

8. y

9. x y z,

10. x

11. . , .

12. A, B, r1, r2 - . ', r1 r2 A B.

13. , : 7, 14. : ˲ ² (1) Ʋ (2)? .

14. ', (x, y) ( , 10, 1,5) ( (a, b), R).

15. .

16. (x - ).

17. a b - , c d - . , .

18. . , , ; , ; ( ), Ӫ .

19. . , .

20. ϳ x 㳿. 㳿, , (1 / y .).

21. ³ : r1 - k1 , r2 - k2, r3 - k3. , (, ).

22. , , .

23. ϳ . , k. 2 . k :

ʳ K
39  
40 - 44 1.2
45 - 49 1.5
>49 1.8

24. ³, a, b, c, d - . , , ( , ).

25. . , (x, y).

 

 

1. ?

2. Turbo Pascal ?

3. ( ) ?

4. ?

5. ?

6. 㳿 ?

7. , ?

8. ?

9. , ?

10. ?

11. ?

12. , ?






:


: 2016-12-06; !; : 1689 |


:

:

, .
==> ...

1279 - | 1244 -


© 2015-2024 lektsii.org - -

: 0.2 .