jayanth.devarayanadurga
Banned
- Joined
- Dec 4, 2012
- Messages
- 4,280
- Helped
- 822
- Reputation
- 1,654
- Reaction score
- 791
- Trophy points
- 1,393
- Location
- Bangalore, India
- Activity points
- 0
What part of coding do you have problem?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Say you have 10 cnis then you can have another array repeat[10].
For every cnic in the 2D array you can check and maintain this new array repeat. If a vote has been casted for a cnic at index 0 of the 2D array then you can place an integer 1 in the repeat array at index 0.
If this cnic appears again you can look for the array repeat and check if the value at the corresponding index is zero or one. If it is zero then the person can be allowed to cast his vote otherwise the message can be displayed saying that the person has already casted his vote.
I have posted the voter1.txt in one of my previous posts. In that the first cnic is repeated 2 times at the end.you just explained that you have duplicated the cnics in sdcard file...does it work fine for my scenario,
If a vote has been casted for a cnic at index 0 of the 2D array then you can place an integer 1 in the repeat array at index 0.
If this cnic appears again you can look for the array repeat and check if the value at the corresponding index is zero or one.
How do you know that the cnic XXXXX-XXXXXXX-X has repeated? With what are you comparing it?
Then you don't even need cnics_array[][]. Read cnics from sd card and match it with barcode data. If there is a match then the message "Can't cast vote" "cnic already used". If no match then message "Can cast vote" "cnic not used"i m reading cnics from sdcard in cnics_array and then comparing it with barcode
can you please upload the code you have explained earlier
Then you don't even need cnics_array[][]. Read cnics from sd card and match it with barcode data. If there is a match then the message "Can't cast vote" "cnic already used". If no match then message "Can cast vote" "cnic not used"