I am coding a program which will simulate a ballot box, where voting wil take place. The code generates a random number which is the voter number which is unique to each voter. This is output to the user before voting. I would like it to perform a check to see if the voter number has been used before or not. i will do this by asking the voter to input there voter number and then perform the check. Please help. Thanks a lot i know i have to use a loop to go through each number and see if it matches or not. But i dont know how to store the voter number as the program will have to be able to store anywhere between 2 and 5000.
Jump to Post
' /* Declare A New Stack Object */ Dim usedIDs As New Stack ' /* Assume User Enters VoterID In Textbox1 */ if usedIDs.Contains(textbox1.text) then ' /* Voter Number Has Not Been Used Yet So... */ ' /* Add Item To Stack */ usedIDs.Push(textbox1.text) ' /* Keep …
All 2 Replies
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.