.


:




:

































 

 

 

 





1.

- ;

- .

2. .

3.

4. ( ).

 

:

1. . , - , .

2. y,

5, x^2 -

= 0, sqrt()<20

-5, cos x - 0.3<0.2

tg x, -

 

:

1. (Panel).

2. , :

 

3. :

 

4. . , , 1. , :

- 1;

- 2.

 

5. 2 . Close, Panel2, .

 

:

 

, :

 

, .

1:

procedure TForm1.Button1Click(Sender: TObject);

var x,y,z:real;

Begin

x:=strToFloat(LabeledEdit1.Text);

y:= strToFloat(LabeledEdit2.Text);

z:=strToFloat(LabeledEdit3.Text);

if x<0

then LabeledEdit4.Text:= FloatToStr(sqr(x))

Else

if x>0

then LabeledEdit4.Text:= FloatToStr(sqrt(x))

Else

Begin

ShowMessage(' ');

LabeledEdit1.SelectAll;

LabeledEdit1.SetFocus

end;

if y<0

then LabeledEdit5.Text:= FloatToStr(sqr(y))

Else

if y>0

then LabeledEdit5.Text:= FloatToStr(sqrt(y))

Else

Begin

ShowMessage(' ');

LabeledEdit2.SelectAll;

LabeledEdit2.SetFocus

end;

if z<0

then LabeledEdit6.Text:= FloatToStr(sqr(z))

Else

if z>0

then LabeledEdit6.Text:= FloatToStr(sqrt(z))

Else

Begin

ShowMessage(' ');

LabeledEdit3.SelectAll;

LabeledEdit3.SetFocus

end;

end;

2:

procedure TForm1.Button4Click(Sender: TObject);

var x:integer;

Begin

x:=strToInt(LabeledEdit7.Text);

if not odd(sqr(x))

Then begin

Edit1.Text:= 'x^2 - '; LabeledEdit8.Text:= ' y=5 '

End

else if sqrt(x)<20

Then begin

Edit1.Text:= 'sqrt(x)<20'; LabeledEdit8.Text:= ' y=0 '

End

else if (cos(x)-0.3)<0.2

Then begin

Edit1.Text:= '(cos(x)-0.3)<0.2';

LabeledEdit8.Text:= ' y= -5 '

End

else if odd(x)

Then begin

Edit1.Text:= 'x - ';

LabeledEdit8.Text:=FloatToStr(sin(x)/cos(x))

End

end;

:

1. .

2. .. Delphi

 

 





:


: 2017-02-25; !; : 193 |


:

:

, .
==> ...

1031 - | 843 -


© 2015-2024 lektsii.org - -

: 0.009 .