Love What You Do, Do What You Love

Program Mencari Akar Hampiran dengan Metode Iterasi Titik Tetap Menggunakan Delphi 7

Posted by : Unknown
Selasa, 26 November 2013

Pseudo Code:

var
x0,x1,e,p,q:real;
i,n:integer;
begin
  x0:=strtofloat(edit1.Text);
  e:=0.0001;
  i:=0;
  n:=strtoint(edit2.Text);
  repeat
    i:=i+1;
    listbox1.Items.add(inttostr(i));
    listbox2.Items.add(floattostr(x0));
    x1:=sqrt(cos(x0));
    listbox3.Items.add(floattostr(x1));
    p:=(x1-x0)/x1;
    q:=abs(p);
    listbox4.Items.add(floattostr(q));
    x0:=x1;
  until
    q<e;
  edit3.Text:=floattostr(x1);
end;

end.

0 comments:

Copyright © 2012 Zuka Zuka World | Hatsune Miku Theme | Designed by Johanes DJ