Cari Blog Ini

Selasa, 30 November 2010

delphi Simple minimarket accounting

Created with Delphi 7 by Avid/Kira
Simple minimarket accounting

Sintak:
unit Unit1;

interface

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

type
TForm1 = class(TForm)
Label1: TLabel;
Edit1: TEdit;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Anggota: TCheckBox;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Label8: TLabel;
Button1: TButton;
Edit2: TEdit;
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
jnsbrg: TComboBox;
hrgbrg: TEdit;
jmlbeli: TEdit;
Diskon: TLabel;
Bayar: TLabel;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var tambah, potongan : real;
begin
if anggota.Checked then
tambah:=0.05
else
tambah:=0;

case jnsbrg.ItemIndex of
0 : potongan:=0.05;
1 : potongan:=0.1;
2 : potongan:=0.15;
end;

diskon.Caption:=floattostr((strtofloat(hrgbrg.Text)*
strtofloat(jmlbeli.Text)*potongan)+
(tambah*strtofloat(hrgbrg.Text)*strtofloat(jmlbeli.Text)));
bayar.Caption:=floattostr((strtofloat(hrgbrg.Text)*
StrTofloat(jmlbeli.Text))-
strtofloat(diskon.Caption));
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
Application.Terminate;
end;

end.

Tidak ada komentar:

Posting Komentar