|
III. Matetatik model asosida dastur algoritmi tuzish
|
bet | 6/7 | Sana | 21.05.2024 | Hajmi | 0,87 Mb. | | #248304 |
Bog'liq 10 sinf tenglamalar sistemasi 2024III. Matetatik model asosida dastur algoritmi tuzish.
Dastur algoritmini (Button1) tugmasining (On Click) hodisasini joriylashtirib,modullarni tahrir qilish oynasida tugma nomiga ochilgan protsedura tarkibiga algoritmni kiritamiz.
procedure TForm1.Button1Click(Sender: TObject);
var a,b,c,d,e,k,x,y:real;
//-----------------------------
function ts2:real; var y:real;
begin y:=(k*a-d*c)/(a*e-b*d);
ts2:=y; end;
//-----------------------------
function ts1:real; var x:real;
begin x:=(c-(b*ts2))/a;
ts1:=x; end;
//------------------------------
//------------------------------
begin
a:=strtofloat(Edit1.Text); b:=strtofloat(Edit2.Text);
c:=strtofloat(Edit3.Text); d:=strtofloat(Edit4.Text);
e:=strtofloat(Edit5.Text); k:=strtofloat(Edit6.Text);
Edit7.Text:=floattostr(ts1); Edit8.Text:=floattostr(ts2);
//-------------------------------
end; end.
procedure TForm1.Button2Click(Sender: TObject);
begin
Edit1.Clear; Edit2.Clear; Edit3.Clear; Edit4.Clear;
Edit5.Clear; Edit6.Clear; Edit7.Clear; Edit8.Clear; end;
IV. Xatolarni tuzatish, natijaviy qismga o`tish.
Kiritilgan dasturni bir necha marotaba xatolarni tuzatgunga qadar kopilasiya jarayonidan o`tkazish.
VI. Misollar yechish, dastur ishini tugatish.
Natijaviy qismda kiritiladidan misol elementlari
|
| |