Question
Ok, my newest project is the election (even though it happened earlier its still that) but anyways, I have to code a program that looks at a set number of votes, decides if they're valid or not (based on a SSN and a barcode and verifying whether they're correct, kinda long process may explain later) and then outputs the votes for each state and the winner of the election. The basic premise of the project is to use an amount of arrays and loops to count a number of items. I'm not sure if this is the right way, but I'm trying to read in the file that contains each state's offical abbreviation (AL- alabama, etc) and the amount of electoral votes (this file includes district of columbia (DC) ) is it possible to read in something like "AL 12" or whatever into an element of an array? or am I taking the wrong approach?
EDIT-Mentioning the barcode validation thing...
basically a number like 0-26065-09985-8
you add all the odd digits in this case (0, 6, 6, 0, 9, 5)
multiply that sum X 3.
then add all even digits (2, 0, 5, 9, 8, 8)
then add those two together, if it's divisible by 10 its valid otherwise its invalid...any ideas of how to store that barcode into an array (char or four integers possibly) and still be able to carry out that operation?
EDIT-Mentioning the barcode validation thing...
basically a number like 0-26065-09985-8
you add all the odd digits in this case (0, 6, 6, 0, 9, 5)
multiply that sum X 3.
then add all even digits (2, 0, 5, 9, 8, 8)
then add those two together, if it's divisible by 10 its valid otherwise its invalid...any ideas of how to store that barcode into an array (char or four integers possibly) and still be able to carry out that operation?
