Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- procedure TFKJW.Button1Click(Sender: TObject);
- Var
- a,b:Real;
- begin
- a:=StrToFloat(EJarak.Text);
- b:=StrToFloat(EWaktu.Text);
- If (Combobox1.ItemIndex=0) And
- (ComboBox2.ItemIndex=0) then
- Begin
- LHasil.Caption:=FloatToStr(a/b) + ' Km/Jam' ;
- End
- Else If (Combobox1.ItemIndex=0) And
- (ComboBox2.ItemIndex=1) then
- Begin
- LHasil.Caption:=FloatToStr(a/(b/60)) + ' Km/Jam' ;
- End
- Else If (Combobox1.ItemIndex=0) And
- (ComboBox2.ItemIndex=2) then
- Begin
- LHasil.Caption:=FloatToStr(a/(b/3600)) + ' Km/Jam' ;
- End
- Else If (Combobox1.ItemIndex=1) And
- (ComboBox2.ItemIndex=0) then
- Begin
- LHasil.Caption:=FloatToStr((a/100)/b) + ' Km/Jam' ;
- End
- Else If (Combobox1.ItemIndex=1) And
- (ComboBox2.ItemIndex=1) then
- Begin
- LHasil.Caption:=FloatToStr((a/100)/(b/60)) + ' Km/Jam' ;
- End
- Else If (Combobox1.ItemIndex=1) And
- (ComboBox2.ItemIndex=2) then
- Begin
- LHasil.Caption:=FloatToStr((a/100)/(b/3600)) + ' Km/Jam' ;
- End;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement