Pages

Latihan 3 Pemrograman Visual


procedure TForm1.RadioButton1Click(Sender: TObject);
var
a:real;
begin
a:=strtofloat(edit1.Text);
a:=1000;
edit1.Text:=floattostr(a);
edit4.text:=edit1.Text;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
edit1.Text:='0';
edit2.Text:='0';
edit3.Text:='0';
combobox1.Text:='';
combobox2.Text:='';
end;

procedure TForm1.RadioButton2Click(Sender: TObject);
var
a:real;
begin
a:=strtofloat(edit1.Text);
a:=1500;
edit1.Text:=floattostr(a);
edit4.text:=edit1.Text;
end;

procedure TForm1.RadioButton3Click(Sender: TObject);
var
a:real;
begin
a:=strtofloat(edit1.Text);
a:=2000;
edit1.Text:=floattostr(a);
edit4.text:=edit1.Text;
end;

procedure TForm1.ComboBox1Change(Sender: TObject);
var
b,q,w:real;
begin
q:=strtofloat(edit4.Text);
if combobox1.Text='Sate' then
    b:=20000;
if combobox1.Text='Gulai' then
    b:=15000;
if combobox1.Text='Tongseng' then
    b:=25000;
edit1.Text:=floattostr(b);
w:=q+b;
edit1.text:=floattostr(w);
edit5.text:=edit1.Text;
end;

procedure TForm1.ComboBox2Change(Sender: TObject);
var
c,r,t:real;
begin
r:=strtofloat(edit5.Text);
if combobox2.Text='Semangka' then
    c:=2000;
if combobox2.Text='Jeruk' then
    c:=1000;
if combobox2.Text='Nanas' then
    c:=1500;
edit1.Text:=floattostr(c);
t:=r+c;
edit1.Text:=floattostr(t);
edit6.text:=edit1.Text;
end;

procedure TForm1.Button1Click(Sender: TObject);
var
x,y,z:real;
begin
x:=strtofloat(edit1.Text);
y:=strtofloat(edit2.Text);
z:=y-x;
if y<x then showmessage('Maaf Pembayaran Anda Kurang');
edit3.Text:=floattostr(z);
end;

procedure TForm1.Button3Click(Sender: TObject);
begin
close;
end;

procedure TForm1.CheckBox1Click(Sender: TObject);
var
a,h,i:real;
begin
h:=strtofloat(edit6.Text);
a:=10000;
edit1.Text:=floattostr(a);
i:=h+a;
edit1.Text:=floattostr(i);
end;

procedure TForm1.RadioGroup1Click(Sender: TObject);
begin

end;

end.

0 komentar:

Posting Komentar