Minggu, 17 April 2011

TUGAS BORLAND DHELFI


KETENTUAN SOAL
Kode Obat                  Nama Obat                            Harga                    Satuan 
AMX                           Amoxilin                                 5000                     Botol
FLV                             Folvit                                      1000                     Kapsul
FNF                                        Fornafit                                              10000                           Botol




 LISTINGNYA

unit Program_linaaa;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ComCtrls;
type
  TForm1 = class(TForm)
    Label1: TLabel;
    Label2: TLabel;
    GroupBox1: TGroupBox;
    Label3: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    Label6: TLabel;
    Enama: TEdit;
    Eharga: TEdit;
    Esatuan: TEdit;
    Label7: TLabel;
    Label8: TLabel;
    Label9: TLabel;
    Label10: TLabel;
    Ejumbel: TEdit;
    Etotal: TEdit;
    Ebay: TEdit;
    Ekem: TEdit;
    Label11: TLabel;
    DateTimePicker1: TDateTimePicker;
    Button1: TButton;
    BKeluar: TButton;
    Cbkode: TComboBox;
    procedure CbkodeClick(Sender: TObject);
    procedure EjumbelKeyPress(Sender: TObject; var Key: Char);
    procedure EbayKeyPress(Sender: TObject; var Key: Char);
    procedure Button1Click(Sender: TObject);
    procedure BKeluarClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.CbkodeClick(Sender: TObject);
begin
if cbkode.Text='AMX'then
begin
enama.Text:='Amoxilin';
eharga.Text:='5000';
esatuan.Text:='Botol';
end
else
if cbkode.Text='FLV'then
begin
enama.Text:='Folvit';
eharga.Text:='1000';
esatuan.Text:='Kapsul';
end
else
if cbkode.Text='FNF'then
begin
enama.Text:='Fornafit';
eharga.Text:='10000';
esatuan.Text:='Botol';
end
end;

procedure TForm1.EjumbelKeyPress(Sender: TObject; var Key: Char);
begin
if key=#13 then
etotal.Text:=floattostr(strtofloat(eharga.Text)*(strtofloat(ejumbel.Text)));

end;

procedure TForm1.EbayKeyPress(Sender: TObject; var Key: Char);
begin
if key=#13 then
ekem.Text:=floattostr(strtofloat(ebay.Text)-(strtofloat(etotal.Text)));

end;

procedure TForm1.Button1Click(Sender: TObject);
begin
enama.Text:=' ';
eharga.Text:=' ';
esatuan.Text:=' ';
ejumbel.Text:='0';
etotal.Text:='0';
ebay.Text:='0';
ekem.Text:='0';
end;

procedure TForm1.BKeluarClick(Sender: TObject);
begin
if(application.MessageBox('Anda Yakin Keluar Akan Keluar','Informasi',MB_YESNO+mb_iconwarning)=IDYES)then
close
end;

end.






     

Tidak ada komentar:

Posting Komentar