Advertisement
Guest User

Untitled

a guest
Jan 17th, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. Module Module1
  2.  
  3. Sub Main()
  4. Dim GTIN(6) As Integer
  5. For c = 0 To 6 ' c = counter up to 7
  6. Console.WriteLine("Enter number " & (c + 1)) ' asks the user to enter a number until counter reaches 7
  7. 'continually asks the user to enter the GTIN numbers until the 7th number is entered
  8. GTIN(c) = Console.ReadLine
  9. If GTIN(c) < 0 Or GTIN(c) > 49 Then
  10. 'making sure that the GTIN number is between 0 and 49 if not a message is outputted
  11. Console.WriteLine("Invalid number entered, number must be between 0 and 49, enter it again")
  12. ' outputs this message when a number is over 49 or a minus
  13. GTIN(c) = Console.ReadLine
  14. End If
  15. Next
  16.  
  17. End Sub
  18.  
  19. End Module
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement