Posts

Showing posts from August 22, 2011

Menghitung lembar uang di vb6

Berikut ini adalah coding untuk menghitung lembar uang dalam vb 6.0Sub HitungLembarUang(sTotalUang As Double)
Dim Sisa As Double
Dim SeratusRibu As Integer
Dim LimaPuluhRibu As Integer
Dim DuaPuluhRibu As Integer
Dim SepuluhRibu As Integer
Dim LimaRibu As Integer
Dim Seribu As Integer
Dim LimaRatus As Integer
Dim Seratus As Integer
Dim LimaPuluh As Integer

SeratusRibu = (sTotalUang \ 100000)
Sisa = sTotalUang Mod 100000 LimaPuluhRibu = (Sisa \ 50000)
Sisa = Sisa Mod 50000 DuaPuluhRibu = (Sisa \ 20000)
Sisa = Sisa Mod 20000 SepuluhRibu = (Sisa \ 10000)
Sisa = Sisa Mod 10000 LimaRibu = (Sisa \ 5000)
Sisa = Sisa Mod 5000 Seribu = (Sisa \ 1000)
Sisa = Sisa Mod 1000 LimaRatus = (Sisa \ 500)
Sisa = Sisa Mod 500 Seratus = (Sisa \ 100)
Sisa = Sisa Mod 100 LimaPuluh = (Sisa \ 50)
Sisa = Sisa Mod 50

MsgBox “100 Ribu = ” & SeratusRibu &…