DENGAN CODING VISUAL BASIC 6.0
Program nya sebagai berikut :
Dim awal As
Date
Dim akhir
As Date
Dim lama As
Single
Dim biaya
As Currency
Private Sub
cmdproses_Click()
If
cmdproses.Caption = "START" Then
awal = Now
lblmulai.Caption
= Format(awal, "hh:mm:ss")
cmdproses.Caption
= "STOP"
ElseIf
cmdproses.Caption = "STOP" Then
Timer1.Enabled
= False
akhir = Now
lama =
akhir - awal
lbldur.Caption
= Format(lama, "hh:mm:ss")
Lblbiaya.Caption
= "Rp" & 15 * CSng(Second(Now - awal)) + 1500 * CSng(Minute(Now -
awal)) + 90000 * CSng(Hour(Now - awal)) & ",-"
cmdproses.Caption
= "EXIT"
ElseIf
cmdproses.Caption = "EXIT" Then
jawab =
MsgBox(" apakah anda yakin akan keluar?", vbYesNo,
"peringatan")
If jawab =
6 Then
Unload Me
End If
End If
End Sub
Private Sub
Timer1_Timer()
a =
Left(Label1.Caption, 1)
b =
Len(Label1.Caption)
c =
Right(Label1.Caption, b - 1)
Label1.Caption
= c + a
lbljam.Caption
= Time
lbljam.Caption
= "sekarang jam : " & Format(Now, "hh:mm:ss")
If cmdproses.Caption
= " stop" Then
lbldurasi.Caption
= Format(Now - awal, "hh:mm:ss")
End If
End Sub