Selasa, 19 April 2011

Listing Matriks Satu Dimensi

 TUGAS :     BUAT TOMBOL DENGAN MENCARI NILAI MAKSIMUM,             KUMPULKAN DALAM BENTUK SOURCECODE (CODING)
    PALING LAMBAT DIKUMPULKAN TANGGAL 23 APRIL 2011




unit Unit_array;
 
var
  Form1: TForm1;
  nilai : array [0..4] of integer ;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
 VAR I, MINIMAL ,posisi : INTEGER ;
begin
  nilai[0] := strtoint (ed0.Text);
  nilai[1] := strtoint (ed1.Text);
  nilai[2] := strtoint (ed2.Text);
  nilai[3] := strtoint (ed3.Text);
  nilai[4] := strtoint (ed4.Text);
  MINIMAL := nilai [0] ;
  posisi := 0 ;
  FOR I := 1 TO 4 DO
  BEGIN
     if nilai [I] < MINIMAL THEN
     begin
         MINIMAL :=nilai [I] ;
         posisi := I ;
     end;
  END;
  if posisi = 4 then showmessage ('munir') ;
   if posisi = 3 then showmessage ('melinda') ;
    if posisi = 2 then showmessage ('syahrini') ;
     if posisi = 1 then showmessage ('norman') ;
      if posisi = 0 then showmessage ('andi') ;

end;

procedure TForm1.Button3Click(Sender: TObject);
begin
application.Terminate ;
end;

end.

1 komentar:

Unknown mengatakan...

thanks bu ,nih saya julfansyah 2i'numpang taruh link blog' : kumpulan nomer cantik klik www.punyaunda.blogspot.com