Minggu, 30 Oktober 2016

Program Delphi Daily Problem "KATAK"

procedure TKatak.Button1Click(Sender: TObject);
Var
  h,k,j,n,s:integer;
begin
  h:=StrToInt(Edit1.Text);
  k:=0;
  for s:=1 to n do
  begin
    j:=k+6;
    k:=j-5;
    if j=h then listbox1.items.add('Hari ke- '+IntToStr(s)+'Katak Sampai Ke Permukaan');
    if j<h then listbox1.items.add('Hari ke- '+IntToStr(s)+' = '+IntToStr(k)+'Meter');

end;
end;

procedure TKatak.Button2Click(Sender: TObject);
begin
edit1.Text:=' ';
listbox1.Items.clear;
end;

procedure TKatak.Timer1Timer(Sender: TObject);
begin
label7.Left:=label7.Left-30;
 if  label7.Left<=-300 then
 label7.Left := 450;
end;

procedure TKatak.Button3Click(Sender: TObject);
begin
DailyProblems.Show;
Katak.Hide;
end;

end.

0 komentar:

Posting Komentar