.


:




:

































 

 

 

 


Memo1




Memo1.Lines.Add(' S = '+FloatToStrF(s,fffixed,8,3));

end;

end.

1.4.

. , , , . , . Edit, label. . 2.

, .

1.

x=14.26, y=-1.22, z=3.5´10-2 t=0.564849.

2.

x=-4.5, y=0.75´10-4, z=0.845´10-2 u=-55.6848.

3.

x=3.74´10-2, y=-0.825, z=0.16´102, v =1.0553.

4.

x=0.4´104, y=-0.875, z=-0.475´10-3 w =1.9873.

5.

x=-15.246, y=4.642´10-2, z=20.001´102 a =-182.036.

6.

x=16.55´10-3, y=-2.75, z=0.15 b =-40.63069.

7.

x=0.1722, y=6.33, z=3.25´10-4 g =-205.306.

8.

x=-2.235´10-2, y=2.23, z=15.221 j =39.374.

9.

x=1.825´102, y=18.225, z=-3.298´10-2 y =1.2131.

10.

x=3.981´10-2, y=-1.625´103, z=0.512 a =1.26185.

11.

x=6.251, y=0.827, z=25.001 b =0.7121.

12.

x=3.251, y=0.325, z=0.466´10-4 c =4.025.

13. .

x=17.421, y=10.365´10-3, z=0.828´105 f =0.33056.

14. .

x=12.3´10-1, y=15.4, z=0.252´103 g =82.8257.

15. .

x=2.444, y=0.869´10-2, z=-0.13´103, h =-0.49871.


 

2. DELPHI.

: (TheckBox, TRadioGroup). .

2.1.

, , .., Windows . DELPHI . Events .

. , Events, , () . DELPHI .

, . . 2.1.

2.1
OnActivate
OnCreate   ( TForm). , ,
OnKeyPress   . Key Char ASCII- ( Enter #13, Esc - #27 ..).
OnKeyUp OnKeyDown
OnClick
OnDblClick

2.2. if case

Pascal boolean, - true false (, ), if case. if , boolean, .

, bl: boolean, x, y, u: integer, if :

bl:=x>y;

if bl then u:=y-x

else u:=x-y;

case .

, in: integer,

Case in of

0: u:=x+y;

1, 5: u:=x-y;

2, 4, 6: u:=x*y;

else u=0;

end;

in u. in=0, u=x+y, in=1 5, u=x-y, in=2 4 6, u=x*y , , u=0 in 0, 1, 2, 4, 5, 6.

2.3. - Delphi

DELPHI -. ( - ) . (.2.1) - (TCheckBox, TRadioGroup).

TCheckBox , /. , if.

TRadiogroup - . . (0,1,2,..), case.

2.4.

: - x, y, z. u=sin(x) u=x2, u=ex. : u, y,z. .

, . 2.1, .

. 2.1.

2.4.1. Co

, , TEdit.

2.4.2. TheckBox

Standard . (Caption) . CheckBox1 TheckBox. , , CheckBox1.Checked true false.

2.4.3. TRadioGroup

Standard . RadioGroup1. (Caption) u=. , Columns ( ). Items , . : cos(x),. x , x, .

- .

, RadioGroup1 TRadioGroup. RadioGroup1.ItemIndex ( ), .

. 2.1. 2.1.

2.1.

unit Unit2;

interface

uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

Dialogs, StdCtrls, ExtCtrls;

type

TForm1 = class(TForm)

Label1: TLabel;

Edit1: TEdit;

CheckBox1: TCheckBox;

RadioGroup1: TRadioGroup;

Label2: TLabel;

Edit2: TEdit;

Label3: TLabel;

Edit3: TEdit;

Label4: TLabel;

Memo1: TMemo;

Button1: TButton;

procedure FormCreate(Sender: TObject);

procedure Button1Click(Sender: TObject);

private { Private declarations }

public { Public declarations }

end;

 

var

Form1: TForm1;

 

implementation

{$R *.dfm}

 

procedure TForm1.FormCreate(Sender: TObject);

begin

Edit1.text:='0,1';

Edit2.text:='0,356';

Edit3.text:='0,53';

Memo1.Clear;

Memo1.Lines.Add('- . . 552002 ..');

RadioGroup1.ItemIndex:=0; // RadioGroup1

end;

 

procedure TForm1.Button1Click(Sender: TObject);

var x,y,z,u,ma:extended;

begin

//

x:=StrToFloat(Edit1.Text);

y:=StrToFloat(Edit2.Text);

z:=StrToFloat(Edit3.Text);

//

Memo1.Lines.Add(' x='+FloatToStrF(x,ffFixed,8,4));

Memo1.Lines.Add(' y='+FloatToStrF(y,ffFixed,8,4));

Memo1.Lines.Add(' z='+FloatToStrF(z,ffFixed,8,4));

//

case RadioGroup1.ItemIndex of

0: u:=cos(x);

1: u:=sqr(x);

2: u:=exp(x);

end;

//

if u>y then ma:=u else ma:=y;

if z>ma then ma:=z;

//

if CheckBox1.Checked then // CheckBox1

Memo1.Lines.Add(' max='+IntToStr(Round(ma))

else

Memo1.Lines.Add(' max='+FloatToStrF(ma,ffGeneral,8,2));

end;

end.

2.5.

. . f(x) : sh(x) x2 ex. , . . 2.1. Button1.Click Memo1Click Label1DblClick

.

    1.   2.
    3.     4.
    5.     6.
    7.     8.
    9.     10.
  11.   12.
  13.   14.
15.    

 


 

3. DELPHI. .

: DELPHI. .

3.1. DELPHI

.

( ) (, ). DELPHI , . , . , , . . HELP F1. , , . , , .

( ) . , , . , .. , . , DELPHI.

. F4 ( ) ( ) F9. . ( ), Ctrl-F7 ( ) Ctrl-F5 ( ) . F7 ( ), , . , F4 . <Run> Run F9.

3.2. repeat, whyle, for Pascal

. . Pascal .

Repeat

<>

until <>;

, repeat until, , <>=true, .





:


: 2016-11-18; !; : 762 |


:

:

.
==> ...

797 - | 754 -


© 2015-2024 lektsii.org - -

: 0.057 .