Rabu, 20 April 2011

latihan Quis






procedure TForm1.ckodeClick(Sender: TObject);
begin
if ckode.Text ='LNV' then
begin
enama.Text :='Lenovo Pentium4';
eharga.Text :='3000000';
end
else
begin
enama.Text :='Acer Pentium4';
eharga.Text :='3500000';
end;
end;

procedure TForm1.rcorei3Click(Sender: TObject);
begin
if rcorei3.Checked =true then
etambahan.Text :='500000'

end;

procedure TForm1.rcorei5Click(Sender: TObject);
begin
if rcorei5.Checked =true then
etambahan.Text :='1000000'

end;

procedure TForm1.chkipasClick(Sender: TObject);
begin
if chkipas.Checked =true then
ekipas.Text :='30000'
else
ekipas.Text :='0' ;
ejumbel.SetFocus
end;

procedure TForm1.ejumbelKeyPress(Sender: TObject; var Key: Char);
var a,b,c,d,total,diskon:real;
begin
if key=#13 then
begin
a:=strtofloat(eharga.Text);
b:=strtofloat(etambahan.Text);
c:=strtofloat(ekipas.Text);
d:=strtofloat(ejumbel.Text);
total:=(a*d)+(b+c);
etotal.Text :=floattostr(total);
if ejumbel.Text >= '3' then
begin
diskon :=(a*d)*0.1;
ediskon.Text :=floattostr(diskon);
end
else
if ejumbel.Text > '1' then
begin
diskon:=(a*d)*0.05;
ediskon.Text :=floattostr(diskon);
end
else
begin
diskon:=0;
ediskon.Text :=floattostr(diskon);
end;
ejumbay.Text :=floattostr(total -diskon );
end;
end;



procedure TForm1.binputClick(Sender: TObject);
begin
etgl.Text :=datetostr(date);
ckode.Text :='';
enama.Text :='';
eharga.Text :='0';
ekipas.Text :='0';
etambahan.Text :='0';
ejumbel.Text :='0';
etotal.Text :='0';
ediskon.Text :='0' ;
ejumbay.Text :='0' ;
rcorei3.Checked :=false ;
rcorei5.Checked :=false  ;
chkipas.Checked :=false  ;
end;

procedure TForm1.bkeluarClick(Sender: TObject);
begin
if(Application.MessageBox('Yakin Ingin Keluar?','informasi',mb_yesno)=idyes)then
close;

end;

end.

Tidak ada komentar:

Posting Komentar