Minggu, 30 Oktober 2016

Program Delphi Daily Problem "BONUS"

procedure TBonus.Button1Click(Sender: TObject);
Var
  p:real;
begin
  p:=strtofloat(edit1.Text);
  if p>= 500000 then edit2.Text:='Tiket Ke Swiss' else
  if (p>=400000) and (p<500000) then edit2.Text:='Jam Tangan Rolex' else
  if (p>=300000) and (p<400000) then edit2. text:='Tiket Ke Bali' else
  if (p>=200000) and (p<300000) then edit2.Text:='Tiket Ke Yogya' else
  if (p>=100000) and (p<200000) then edit2.Text:='Discount 5%' else
  edit2.Text:='Error';

end;

procedure TBonus.Button3Click(Sender: TObject);
begin
edit1.Text:=' ';
edit2.text:=' ';
end;

procedure TBonus.Timer1Timer(Sender: TObject);
begin
label1.Left:=label1.Left-30;
 if  label1.Left<=-300 then
 label1.Left := 750;
end;

procedure TBonus.Button2Click(Sender: TObject);
begin
DailyProblems.Show;
Bonus.Hide;
end;

0 komentar:

Posting Komentar