Monday, August 22, 2011

Menghitung lembar uang di vb6

Berikut ini adalah coding untuk menghitung lembar uang dalam vb 6.0

Sub 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 & vbCrLf & _

“50 Ribu = ” & LimaPuluhRibu & vbCrLf & _
“20 Ribu = ” & DuaPuluhRibu & vbCrLf & _
“10 Ribu = ” & SepuluhRibu & vbCrLf & _
“5 Ribu = ” & LimaRibu & vbCrLf & _
“1 Ribu = ” & Seribu & vbCrLf & _
“5 Ratus = ” & LimaRatus & vbCrLf & _
“Seratus = ” & Seratus & vbCrLf & _
“5 Puluh = ” & LimaPuluh
End Sub

Cara Memperbaiki Error user32.dll is Missing

Jika menemukan error /masalah saat mencoba membuka aplikasi di windows, error seperti ini : “the program can't start because user32.dl...