Protsedura ha'm funksiya


Download 335 Kb.
bet8/9
Sana04.02.2023
Hajmi335 Kb.
#1162549
1   2   3   4   5   6   7   8   9
Bog'liq
9.Prosedura hám Funkciyalar

interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;


type
TForm1 = class(TForm)
Button1: TButton;
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Edit4: TEdit;
Edit5: TEdit;
Edit6: TEdit;
Edit7: TEdit;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
arv
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
a,b,c,d,e,f,s:real;
s1,s2,s3,s4:real;
procedure Sq(x,y,z:real; var s:real);
var p:real;
begin
p:=(x+y+z)/2;
s:=sqrt(p*(p-x)*(p-y)*(p-z));
end;
begin
a:=strtofloat(edit1.Text);
b:=strtofloat(edit2.Text);
c:=strtofloat(edit3.Text);
d:=strtofloat(edit4.Text);
e:=strtofloat(edit5.Text);
f:=strtofloat(edit6.Text);
Sq(a,b,c,s1); Sq(c,d,e,s2); Sq(b,e,f,s3); Sq(a,f,d,s4);
s:=s1+s2+s3+s4;
edit7.Text:='s='+floattostr(s);
end; end.



3.6.4-suwret. Maydandi esaplaw programmasi
6-masele. Shen'berdin' shepden o‘ng'a hareketini ko‘rsetetug'in programma duzin'.
1. Standart komponentalar palitrasinin' Data Access biyikligi tuymeshesi saylanadi ha'm forma ustinde payda boladi.. Natiyjede “Timer1” tuymeshesi payda bo‘ladi.


Download 335 Kb.

Do'stlaringiz bilan baham:
1   2   3   4   5   6   7   8   9




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling