Advertisement
Guest User

Untitled

a guest
Jan 19th, 2017
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 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.  
  20.  
  21. Console.WriteLine("the check digit is" & 10 - (total Mod 10))
  22. Console.ReadLine()
  23.  
  24. Console.WriteLine(GTIN)
  25. Console.ReadLine()
  26.  
  27.  
  28. End Sub
  29.  
  30. End Module
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement