PENGAPLIKASIAAN ARRAY DIDALAM KEHIDUPAN SEHARI – HARI via DELPHI 2010
Ø OUTPUT PROGRAM
Ø
SKRIP PROGRAM
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls,
Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Label1: TLabel;
Edit1: TEdit;
Button1: TButton;
Button2: TButton;
Button3: TButton;
Laporan_Penjualan: TMemo;
Label2: TLabel;
Label3: TLabel;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Edit1Change(Sender: TObject);
private
{
Private declarations }
public
{
Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender:
TObject);
type tbl_hrg = record
nama
: string[20]; hrg : currency;
end;
type array1=array[1..100]of tbl_hrg;
var hrg : array1; n, i, jm : integer; total
: currency;
begin
n:=strtoint(Edit1 .Text );
total:=0;
for i := 1 to n do
with hrg[i] do
begin
Laporan_Penjualan .Lines.add('Barang ke-'+inttostr(i));
nama:=(InputBox('Nama','Nama Barang '+inttostr(i),''));
Laporan_Penjualan .Lines.add('Nama Barang'+#9+(nama));
jm:=strtoint(InputBox('Jumlah','Jumlah Barang '+inttostr(i),''));
hrg:=strtocurr(InputBox('Harga','Harga Persatuan ',''));
Laporan_Penjualan .Lines.add('Harga Persatuan'+#9+'Rp.
'+currtostr(hrg)+',00'+' x '
+inttostr(jm)+' = '+currtostr(hrg*jm));
hrg:= hrg*jm;
total:= total+hrg;
Laporan_Penjualan .Lines.add('');
end;
Laporan_Penjualan
.Lines.add('-----------------------------------------------------------------');
Laporan_Penjualan .Lines.add('Total Harga '+#9+#9+'Rp.
'+currtostr(total)+',00');
end;
procedure TForm1.Button2Click(Sender:
TObject);
begin
Laporan_Penjualan .Clear
end;
procedure TForm1.Button3Click(Sender:
TObject);
begin
Close
end;
procedure TForm1.Edit1Change(Sender:
TObject);
begin
;
end;
end.
0 Response to "PENGAPLIKASIAAN ARRAY DIDALAM KEHIDUPAN SEHARI – HARI via DELPHI 2010"
Post a Comment