unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls,
Forms,
Dialogs, StdCtrls, ExtCtrls;
type
TForm1 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Edit1: TEdit;
Edit2: TEdit;
ComboBox1: TComboBox;
Edit3: TEdit;
Edit4: TEdit;
Edit5: TEdit;
RadioGroup1: TRadioGroup;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender:
TObject);
var jumlah, harga, bayar : real ;
begin
harga:=StrToFloat(Edit3.Text);
jumlah:=StrToFloat(Edit4.Text);
case RadioGroup1.ItemIndex of
0:
if RadioGroup1.ItemIndex=0 then
bayar:=(harga*jumlah) - (harga*jumlah*0.15);
else
bayar:=(harga*jumlah) - (harga*jumlah*0.20);
end;
Edit5.Text:=FloatToStr(bayar);
end;
end.
Tidak ada komentar:
Posting Komentar