Advertisement
Guest User

Untitled

a guest
Jan 19th, 2017
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. Module Module1
  2.  
  3. Sub Main()
  4. Dim GTIN As String
  5.  
  6. Dim total As Integer = 0
  7. Console.WriteLine("please enter a barcode")
  8. GTIN = Console.ReadLine()
  9.  
  10.  
  11. For i = 1 To 7
  12.  
  13. If i Mod 2 <> 0 Then
  14. total = total + (Mid(GTIN, i, 1) * 3)
  15. Else
  16. total = total + (Mid(GTIN, i, 1))
  17. End If
  18. Next
  19. total = 10 - (total Mod 10)
  20. If total = 10 Then
  21. total = 0
  22. End If
  23. Console.WriteLine("the check digit is" & (total))
  24. Console.ReadLine()
  25.  
  26. Console.WriteLine(GTIN)
  27. Console.ReadLine()
  28.  
  29.  
  30. End Sub
  31.  
  32. End Module
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement