You are on page 1of 5

unit Unit1;

interface

uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

Dialogs, StdCtrls, cxLookAndFeelPainters, dxSkinsCore, dxSkinBlack,

dxSkinBlue, dxSkinCaramel, dxSkinCoffee, dxSkinDarkRoom, dxSkinDarkSide,

dxSkinFoggy, dxSkinGlassOceans, dxSkiniMaginary, dxSkinLilian,

dxSkinLiquidSky, dxSkinLondonLiquidSky, dxSkinMcSkin, dxSkinMoneyTwins,

dxSkinOffice2007Black, dxSkinOffice2007Blue, dxSkinOffice2007Green,

dxSkinOffice2007Pink, dxSkinOffice2007Silver, dxSkinPumpkin, dxSkinSeven,

dxSkinSharp, dxSkinSilver, dxSkinSpringTime, dxSkinStardust,

dxSkinSummer2008, dxSkinsDefaultPainters, dxSkinValentine,

dxSkinXmas2008Blue, cxControls, cxContainer, cxEdit, cxGroupBox;

type

TForm1 = class(TForm)

Label1: TLabel;

Label2: TLabel;

Label3: TLabel;

Label4: TLabel;

Label5: TLabel;

Label6: TLabel;

Label7: TLabel;

Label8: TLabel;

Label9: TLabel;

Label10: TLabel;

ComboBox1: TComboBox;

Edit1: TEdit;

Edit2: TEdit;
Edit3: TEdit;

Edit4: TEdit;

Button1: TButton;

Edit5: TEdit;

Edit6: TEdit;

Edit7: TEdit;

Button2: TButton;

Button3: TButton;

Label11: TLabel;

cxGroupBox2: TcxGroupBox;

Label35: TLabel;

Label36: TLabel;

Label37: TLabel;

Label38: TLabel;

Label12: TLabel;

Label13: TLabel;

procedure ComboBox1Change(Sender: TObject);

procedure Button1Click(Sender: TObject);

procedure Button2Click(Sender: TObject);

procedure Button3Click(Sender: TObject);

private

{ Private declarations }

public

total_bayar:real;

{ Public declarations }

end;

var

Form1: TForm1;
implementation

{$R *.dfm}

procedure TForm1.ComboBox1Change(Sender: TObject);

begin

if ComboBox1.Text = '0021' then

Edit1.Text := 'TV LG 21 Inc'

else if ComboBox1.Text = '0022' then

Edit1.Text := 'TV LG 22 Inc'

else if ComboBox1.Text = '0023' then

Edit1.Text := 'TV LG 23 Inc'

else if ComboBox1.Text = '0024' then

Edit1.Text := 'TV LG 24 Inc'

else if ComboBox1.Text = '0025' then

Edit1.Text := 'TV LG 25 Inc'

else if ComboBox1.Text = '0026' then

Edit1.Text := 'TV LG 26 Inc'

else

Edit1.Text := '0';

begin

if ComboBox1.Text = '0021' then

Edit2.Text := '876000'

else if ComboBox1.Text = '0022' then

Edit2.Text := '1000000'

else if ComboBox1.Text = '0023' then

Edit2.Text := '1300000'

else if ComboBox1.Text = '0024' then


Edit2.Text := '1500000'

else if ComboBox1.Text = '0025' then

Edit2.Text := '1600000'

else if ComboBox1.Text = '0026' then

Edit2.Text := '1800000'

else

Edit2.Text := '0';

end;

end;

procedure TForm1.Button1Click(Sender: TObject);

var

harga,jml,total,bayar:real;

begin

harga:=StrToFloat(edit2.Text);

jml:=StrToFloat(edit3.Text);

total:=harga*jml;

edit4.Text:=FloatToStr(total);

end;

procedure TForm1.Button2Click(Sender: TObject);

var harga,jml,total,diskon:real;

begin

diskon:=0;

harga:=StrToFloat(edit2.Text);

jml:=StrToFloat(edit3.Text);

total:=harga*jml;

edit4.Text:=FloatToStr(total);

if total>=876000 then
diskon:=total*0.05

else if total>=1000000 then

diskon:=total*0.06

else if total>=1300000 then

diskon:=total*0.07

else if total>=1500000 then

diskon:=total*0.08

else if total>=1600000 then

diskon:=total*0.09

else if total>=1800000 then

diskon:=total*0.10;

edit5.Text:=FloatToStr(diskon);

end;

procedure TForm1.Button3Click(Sender: TObject);

var

harga,jml,total,bayar,kembali:real;

begin

harga:=StrToFloat(edit2.Text);

jml:=StrToFloat(edit3.Text);

total:=harga*jml;

edit4.Text:=FloatToStr(total);

bayar:=StrToFloat(edit6.Text);

kembali:=bayar - total;

edit6.Text:=FloatToStr(bayar);

edit7.Text:=Floattostr(kembali);

end;

end.

You might also like