Top Post

Top Post

Posted by : Efdi Minggu, 01 Desember 2013


unit bakso;

interface

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

type
  TForm1 = class(TForm)
    lbl1: TLabel;
    lbl2: TLabel;
    lbl3: TLabel;
    lbl4: TLabel;
    lbl5: TLabel;
    lbl6: TLabel;
    lbl7: TLabel;
    edt1: TEdit;
    edt2: TEdit;
    edt3: TEdit;
    edt4: TEdit;
    edt5: TEdit;
    lbl8: TLabel;
    lbl9: TLabel;
    edt6: TEdit;
    edt7: TEdit;
    edt8: TEdit;
    edt9: TEdit;
    edt10: TEdit;
    edt11: TEdit;
    btn1: TButton;
    btn2: TButton;
    btn3: TButton;
    ud1: TUpDown;
    ud2: TUpDown;
    ud3: TUpDown;
    ud4: TUpDown;
    ud5: TUpDown;
    Label1: TLabel;
    Button1: TButton;
    procedure btn3Click(Sender: TObject);
    procedure btn1Click(Sender: TObject);
    procedure ud1Click(Sender: TObject; Button: TUDBtnType);
    procedure ud2Click(Sender: TObject; Button: TUDBtnType);
    procedure ud3Click(Sender: TObject; Button: TUDBtnType);
    procedure ud4Click(Sender: TObject; Button: TUDBtnType);
    procedure ud5Click(Sender: TObject; Button: TUDBtnType);
    procedure btn2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.btn3Click(Sender: TObject);
begin
  Close;
end;

procedure TForm1.btn1Click(Sender: TObject);
var
  k_bakso,k_mi,k_teh,k_jeruk,k_krupuk,
  s_bakso,s_mi,s_teh,s_jeruk,s_krupuk,total:Real;
begin
  k_bakso:=StrToFloat(edt1.Text);
  k_mi:=StrToFloat(edt2.Text);
  k_teh:=StrToFloat(edt3.Text);
  k_jeruk:=StrToFloat(edt4.Text);
  k_krupuk:=StrToFloat(edt5.Text);
  s_bakso:=10000*k_bakso;
  s_mi:=6000*k_mi;
  s_teh:=2000*k_teh;
  s_jeruk:=3000*k_jeruk;
  s_krupuk:=500*k_krupuk;
  total:=s_bakso + s_mi + s_teh + s_jeruk + s_krupuk;

  edt6.Text:=FloatToStr(s_bakso);
  edt7.Text:=FloatToStr(s_mi);
  edt8.Text:=FloatToStr(s_teh);
  edt9.Text:=FloatToStr(s_jeruk);
  edt10.Text:=FloatToStr(s_krupuk);
  edt11.Text:=FloatToStr(total);
end;

procedure TForm1.ud1Click(Sender: TObject; Button: TUDBtnType);
begin
  edt1.Text:=IntToStr(ud1.position);
end;

procedure TForm1.ud2Click(Sender: TObject; Button: TUDBtnType);
begin
  edt2.Text:=IntToStr(ud2.position);
end;

procedure TForm1.ud3Click(Sender: TObject; Button: TUDBtnType);
begin
  edt3.Text:=IntToStr(ud3.position);
end;

procedure TForm1.ud4Click(Sender: TObject; Button: TUDBtnType);
begin
  edt4.Text:=IntToStr(ud4.position);
end;

procedure TForm1.ud5Click(Sender: TObject; Button: TUDBtnType);
begin
  edt5.Text:=IntToStr(ud5.position);
end;

procedure TForm1.btn2Click(Sender: TObject);
begin
  edt1.Text:='';
  edt2.Text:='';
  edt3.Text:='';
  edt4.Text:='';
  edt5.Text:='';
  edt6.Text:='';
  edt7.Text:='';
  edt8.Text:='';
  edt9.Text:='';
  edt10.Text:='';
  edt11.Text:='';
end;

end.

{ 2 comments... read them below or Comment }

  1. mkasih gan ,,, postingan membuat-program-kasir-sederhana-delphi , yang bagus dan bermanfaat ini layaknya di share ajja ,, nih saya bantu ngeshare ,, ,, jgn lupa kunbal nya

    BalasHapus
  2. gk paham ....
    gk ada penjelasannya ...

    BalasHapus

Saran dan kritik Anda merupakan semangat bagi kami. Terima kasih...!

|| Copyright © 2014 Fakti UPY || Powered by Blogger || Designed by Mbah Jass ||