Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Module Module1
- Sub Main()
- Dim GTIN As String
- Dim total As Integer = 0
- Console.WriteLine("please enter a barcode")
- GTIN = Console.ReadLine()
- For i = 1 To 7
- If i Mod 2 <> 0 Then
- total = total + (Mid(GTIN, i, 1) * 3)
- Else
- total = total + (Mid(GTIN, i, 1))
- End If
- Next
- total = 10 - (total Mod 10)
- If total = 10 Then
- total = 0
- End If
- Console.WriteLine("the check digit is" & (total))
- Console.ReadLine()
- Console.WriteLine(GTIN)
- Console.ReadLine()
- End Sub
- End Module
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement