How to find sum of two user populated arrays separately in Java
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
I'm a beginner trying to learn java and arrays are proving to be difficult. Please bear with me, I don't know all of the correct terminology and I'm not great at explaining things.
I'm trying to write a program that will calculate votes per candidate. Those votes are entered by the user. Example: Candidate one's total votes should be 814. The total votes for candidate two should be 773.
What I'm having trouble with is finding the sum of each candidate's votes, and having them print separately. My code just adds the 814 and 773 for a total of 1,587.
for(i = 0; i < precincts.length; i++)
{
System.out.println("How many votes were recieved in this precinct?");
numVotes[i] =scnr.nextInt();
}
for(int vote : numVotes) //Enhanced loop to copy array numVotes to vote
{
totalVotes = totalVotes + vote; //the sum of elements in numvotes to find total votes of both candidates
}
I hope that what I'm asking makes sense to someone. Regardless, thank you in advance for your help!
java arrays
add a comment |
I'm a beginner trying to learn java and arrays are proving to be difficult. Please bear with me, I don't know all of the correct terminology and I'm not great at explaining things.
I'm trying to write a program that will calculate votes per candidate. Those votes are entered by the user. Example: Candidate one's total votes should be 814. The total votes for candidate two should be 773.
What I'm having trouble with is finding the sum of each candidate's votes, and having them print separately. My code just adds the 814 and 773 for a total of 1,587.
for(i = 0; i < precincts.length; i++)
{
System.out.println("How many votes were recieved in this precinct?");
numVotes[i] =scnr.nextInt();
}
for(int vote : numVotes) //Enhanced loop to copy array numVotes to vote
{
totalVotes = totalVotes + vote; //the sum of elements in numvotes to find total votes of both candidates
}
I hope that what I'm asking makes sense to someone. Regardless, thank you in advance for your help!
java arrays
Right now there's too much missing for us to be any use to you - your best bet is to followup directly with your teacher (assuming you're in school) or go through some more basic array examples (there are tons of these available via google search)
– Krease
Nov 24 '18 at 0:16
Wouldn't you want to enter two numbers per precinct, e.g., one number for each candidate? So you'd likely want two collections of votes (in this specific case).
– Dave Newton
Nov 24 '18 at 0:17
add a comment |
I'm a beginner trying to learn java and arrays are proving to be difficult. Please bear with me, I don't know all of the correct terminology and I'm not great at explaining things.
I'm trying to write a program that will calculate votes per candidate. Those votes are entered by the user. Example: Candidate one's total votes should be 814. The total votes for candidate two should be 773.
What I'm having trouble with is finding the sum of each candidate's votes, and having them print separately. My code just adds the 814 and 773 for a total of 1,587.
for(i = 0; i < precincts.length; i++)
{
System.out.println("How many votes were recieved in this precinct?");
numVotes[i] =scnr.nextInt();
}
for(int vote : numVotes) //Enhanced loop to copy array numVotes to vote
{
totalVotes = totalVotes + vote; //the sum of elements in numvotes to find total votes of both candidates
}
I hope that what I'm asking makes sense to someone. Regardless, thank you in advance for your help!
java arrays
I'm a beginner trying to learn java and arrays are proving to be difficult. Please bear with me, I don't know all of the correct terminology and I'm not great at explaining things.
I'm trying to write a program that will calculate votes per candidate. Those votes are entered by the user. Example: Candidate one's total votes should be 814. The total votes for candidate two should be 773.
What I'm having trouble with is finding the sum of each candidate's votes, and having them print separately. My code just adds the 814 and 773 for a total of 1,587.
for(i = 0; i < precincts.length; i++)
{
System.out.println("How many votes were recieved in this precinct?");
numVotes[i] =scnr.nextInt();
}
for(int vote : numVotes) //Enhanced loop to copy array numVotes to vote
{
totalVotes = totalVotes + vote; //the sum of elements in numvotes to find total votes of both candidates
}
I hope that what I'm asking makes sense to someone. Regardless, thank you in advance for your help!
java arrays
java arrays
asked Nov 24 '18 at 0:09
Sabrina RayneSabrina Rayne
31
31
Right now there's too much missing for us to be any use to you - your best bet is to followup directly with your teacher (assuming you're in school) or go through some more basic array examples (there are tons of these available via google search)
– Krease
Nov 24 '18 at 0:16
Wouldn't you want to enter two numbers per precinct, e.g., one number for each candidate? So you'd likely want two collections of votes (in this specific case).
– Dave Newton
Nov 24 '18 at 0:17
add a comment |
Right now there's too much missing for us to be any use to you - your best bet is to followup directly with your teacher (assuming you're in school) or go through some more basic array examples (there are tons of these available via google search)
– Krease
Nov 24 '18 at 0:16
Wouldn't you want to enter two numbers per precinct, e.g., one number for each candidate? So you'd likely want two collections of votes (in this specific case).
– Dave Newton
Nov 24 '18 at 0:17
Right now there's too much missing for us to be any use to you - your best bet is to followup directly with your teacher (assuming you're in school) or go through some more basic array examples (there are tons of these available via google search)
– Krease
Nov 24 '18 at 0:16
Right now there's too much missing for us to be any use to you - your best bet is to followup directly with your teacher (assuming you're in school) or go through some more basic array examples (there are tons of these available via google search)
– Krease
Nov 24 '18 at 0:16
Wouldn't you want to enter two numbers per precinct, e.g., one number for each candidate? So you'd likely want two collections of votes (in this specific case).
– Dave Newton
Nov 24 '18 at 0:17
Wouldn't you want to enter two numbers per precinct, e.g., one number for each candidate? So you'd likely want two collections of votes (in this specific case).
– Dave Newton
Nov 24 '18 at 0:17
add a comment |
1 Answer
1
active
oldest
votes
You don't need two arrays to accomplish this task. You can what is needed with just the array of precincts. It's all a matter of how you ask the User for input and what you do with that input.
You have your precinct array and you are already utilizing it within a for loop. Everything that needs to be acquired can be done through this loop, for example:
String precincts = {"Precinct A", "Precinct B", "Precinct C", "Precinct D"};
int candidate1VoteSum = 0;
int candidate2VoteSum = 0;
for (int i = 0; i < precincts.length; i++) {
System.out.println("nHow many votes were received in: " + precincts[i] + "?");
System.out.print("For Candidate 1: ");
candidate1VoteSum += scnr.nextInt();
System.out.print("For Candidate 2: ");
candidate2VoteSum += scnr.nextInt();
}
Here we merely used two int variables (candidate1VoteSum and candidate2VoteSum)to hold the sum of votes for each candidate. The total votes for each candidate in each precinct is all that is needed. As we iterate through the Precincts we simply ask the User to supply the total votes for each Candidate for that current Precinct.
When the for loop is finished you now have all the necessary data to display to display the voting results, for example:
System.out.println("nCandidate 1 recieved a total of " +
candidate1VoteSum + " votes from all Precincts.");
System.out.println("Candidate 2 recieved a total of " +
candidate2VoteSum + " votes from all Precincts.");
System.out.println("nThe winning Candidate is: " +
// Nested Ternary Operators are used here.
(candidate1VoteSum == candidate2VoteSum ? "It's A Tie!" :
(candidate1VoteSum > candidate2VoteSum ? "Candidate 1" : "Candidate 2"))
);
Here is information on using a Ternary Operator:
If you actually need the total from each Precinct to go into a candidate Array then you can add to the array directly from within the for loop as well but first you will need to declare the integer arrays first and size them to be the same size as the precincts array since each element is only holding the total votes from each Precinct, for example:
String precincts = {"Precinct A", "Precinct B", "Precinct C", "Precinct D"};
int candidate_1_Votes = new int[precincts.length];
int candidate_2_Votes = new int[precincts.length];
int candidate1VoteSum = 0;
int candidate2VoteSum = 0;
// Getting User input with regards to voting results...
for (int i = 0; i < precincts.length; i++) {
System.out.println("nHow many votes were received in: " + precincts[i] + "?");
System.out.print("For Candidate 1: ");
candidate_1_Votes[i] = scnr.nextInt();
candidate1VoteSum += candidate_1_Votes[i];
System.out.print("For Candidate 2: ");
candidate_2_Votes[i] = scnr.nextInt();
candidate2VoteSum += candidate_2_Votes[i];
}
Now that you have your candidate int arrays (candidate_1_Votes and candidate_2_Votes) you can determine which Precinct gave what total votes to whatever Candidate, for example:
for (int i = 0; i < precincts.length; i++) {
System.out.println("n" + precincts[i] + " gave Candidate 1 a total of " +
candidate_1_Votes[i] + " votes.");
System.out.println(precincts[i] + " gave Candidate 2 a total of " +
candidate_2_Votes[i] + " votes.");
}
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53454095%2fhow-to-find-sum-of-two-user-populated-arrays-separately-in-java%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You don't need two arrays to accomplish this task. You can what is needed with just the array of precincts. It's all a matter of how you ask the User for input and what you do with that input.
You have your precinct array and you are already utilizing it within a for loop. Everything that needs to be acquired can be done through this loop, for example:
String precincts = {"Precinct A", "Precinct B", "Precinct C", "Precinct D"};
int candidate1VoteSum = 0;
int candidate2VoteSum = 0;
for (int i = 0; i < precincts.length; i++) {
System.out.println("nHow many votes were received in: " + precincts[i] + "?");
System.out.print("For Candidate 1: ");
candidate1VoteSum += scnr.nextInt();
System.out.print("For Candidate 2: ");
candidate2VoteSum += scnr.nextInt();
}
Here we merely used two int variables (candidate1VoteSum and candidate2VoteSum)to hold the sum of votes for each candidate. The total votes for each candidate in each precinct is all that is needed. As we iterate through the Precincts we simply ask the User to supply the total votes for each Candidate for that current Precinct.
When the for loop is finished you now have all the necessary data to display to display the voting results, for example:
System.out.println("nCandidate 1 recieved a total of " +
candidate1VoteSum + " votes from all Precincts.");
System.out.println("Candidate 2 recieved a total of " +
candidate2VoteSum + " votes from all Precincts.");
System.out.println("nThe winning Candidate is: " +
// Nested Ternary Operators are used here.
(candidate1VoteSum == candidate2VoteSum ? "It's A Tie!" :
(candidate1VoteSum > candidate2VoteSum ? "Candidate 1" : "Candidate 2"))
);
Here is information on using a Ternary Operator:
If you actually need the total from each Precinct to go into a candidate Array then you can add to the array directly from within the for loop as well but first you will need to declare the integer arrays first and size them to be the same size as the precincts array since each element is only holding the total votes from each Precinct, for example:
String precincts = {"Precinct A", "Precinct B", "Precinct C", "Precinct D"};
int candidate_1_Votes = new int[precincts.length];
int candidate_2_Votes = new int[precincts.length];
int candidate1VoteSum = 0;
int candidate2VoteSum = 0;
// Getting User input with regards to voting results...
for (int i = 0; i < precincts.length; i++) {
System.out.println("nHow many votes were received in: " + precincts[i] + "?");
System.out.print("For Candidate 1: ");
candidate_1_Votes[i] = scnr.nextInt();
candidate1VoteSum += candidate_1_Votes[i];
System.out.print("For Candidate 2: ");
candidate_2_Votes[i] = scnr.nextInt();
candidate2VoteSum += candidate_2_Votes[i];
}
Now that you have your candidate int arrays (candidate_1_Votes and candidate_2_Votes) you can determine which Precinct gave what total votes to whatever Candidate, for example:
for (int i = 0; i < precincts.length; i++) {
System.out.println("n" + precincts[i] + " gave Candidate 1 a total of " +
candidate_1_Votes[i] + " votes.");
System.out.println(precincts[i] + " gave Candidate 2 a total of " +
candidate_2_Votes[i] + " votes.");
}
add a comment |
You don't need two arrays to accomplish this task. You can what is needed with just the array of precincts. It's all a matter of how you ask the User for input and what you do with that input.
You have your precinct array and you are already utilizing it within a for loop. Everything that needs to be acquired can be done through this loop, for example:
String precincts = {"Precinct A", "Precinct B", "Precinct C", "Precinct D"};
int candidate1VoteSum = 0;
int candidate2VoteSum = 0;
for (int i = 0; i < precincts.length; i++) {
System.out.println("nHow many votes were received in: " + precincts[i] + "?");
System.out.print("For Candidate 1: ");
candidate1VoteSum += scnr.nextInt();
System.out.print("For Candidate 2: ");
candidate2VoteSum += scnr.nextInt();
}
Here we merely used two int variables (candidate1VoteSum and candidate2VoteSum)to hold the sum of votes for each candidate. The total votes for each candidate in each precinct is all that is needed. As we iterate through the Precincts we simply ask the User to supply the total votes for each Candidate for that current Precinct.
When the for loop is finished you now have all the necessary data to display to display the voting results, for example:
System.out.println("nCandidate 1 recieved a total of " +
candidate1VoteSum + " votes from all Precincts.");
System.out.println("Candidate 2 recieved a total of " +
candidate2VoteSum + " votes from all Precincts.");
System.out.println("nThe winning Candidate is: " +
// Nested Ternary Operators are used here.
(candidate1VoteSum == candidate2VoteSum ? "It's A Tie!" :
(candidate1VoteSum > candidate2VoteSum ? "Candidate 1" : "Candidate 2"))
);
Here is information on using a Ternary Operator:
If you actually need the total from each Precinct to go into a candidate Array then you can add to the array directly from within the for loop as well but first you will need to declare the integer arrays first and size them to be the same size as the precincts array since each element is only holding the total votes from each Precinct, for example:
String precincts = {"Precinct A", "Precinct B", "Precinct C", "Precinct D"};
int candidate_1_Votes = new int[precincts.length];
int candidate_2_Votes = new int[precincts.length];
int candidate1VoteSum = 0;
int candidate2VoteSum = 0;
// Getting User input with regards to voting results...
for (int i = 0; i < precincts.length; i++) {
System.out.println("nHow many votes were received in: " + precincts[i] + "?");
System.out.print("For Candidate 1: ");
candidate_1_Votes[i] = scnr.nextInt();
candidate1VoteSum += candidate_1_Votes[i];
System.out.print("For Candidate 2: ");
candidate_2_Votes[i] = scnr.nextInt();
candidate2VoteSum += candidate_2_Votes[i];
}
Now that you have your candidate int arrays (candidate_1_Votes and candidate_2_Votes) you can determine which Precinct gave what total votes to whatever Candidate, for example:
for (int i = 0; i < precincts.length; i++) {
System.out.println("n" + precincts[i] + " gave Candidate 1 a total of " +
candidate_1_Votes[i] + " votes.");
System.out.println(precincts[i] + " gave Candidate 2 a total of " +
candidate_2_Votes[i] + " votes.");
}
add a comment |
You don't need two arrays to accomplish this task. You can what is needed with just the array of precincts. It's all a matter of how you ask the User for input and what you do with that input.
You have your precinct array and you are already utilizing it within a for loop. Everything that needs to be acquired can be done through this loop, for example:
String precincts = {"Precinct A", "Precinct B", "Precinct C", "Precinct D"};
int candidate1VoteSum = 0;
int candidate2VoteSum = 0;
for (int i = 0; i < precincts.length; i++) {
System.out.println("nHow many votes were received in: " + precincts[i] + "?");
System.out.print("For Candidate 1: ");
candidate1VoteSum += scnr.nextInt();
System.out.print("For Candidate 2: ");
candidate2VoteSum += scnr.nextInt();
}
Here we merely used two int variables (candidate1VoteSum and candidate2VoteSum)to hold the sum of votes for each candidate. The total votes for each candidate in each precinct is all that is needed. As we iterate through the Precincts we simply ask the User to supply the total votes for each Candidate for that current Precinct.
When the for loop is finished you now have all the necessary data to display to display the voting results, for example:
System.out.println("nCandidate 1 recieved a total of " +
candidate1VoteSum + " votes from all Precincts.");
System.out.println("Candidate 2 recieved a total of " +
candidate2VoteSum + " votes from all Precincts.");
System.out.println("nThe winning Candidate is: " +
// Nested Ternary Operators are used here.
(candidate1VoteSum == candidate2VoteSum ? "It's A Tie!" :
(candidate1VoteSum > candidate2VoteSum ? "Candidate 1" : "Candidate 2"))
);
Here is information on using a Ternary Operator:
If you actually need the total from each Precinct to go into a candidate Array then you can add to the array directly from within the for loop as well but first you will need to declare the integer arrays first and size them to be the same size as the precincts array since each element is only holding the total votes from each Precinct, for example:
String precincts = {"Precinct A", "Precinct B", "Precinct C", "Precinct D"};
int candidate_1_Votes = new int[precincts.length];
int candidate_2_Votes = new int[precincts.length];
int candidate1VoteSum = 0;
int candidate2VoteSum = 0;
// Getting User input with regards to voting results...
for (int i = 0; i < precincts.length; i++) {
System.out.println("nHow many votes were received in: " + precincts[i] + "?");
System.out.print("For Candidate 1: ");
candidate_1_Votes[i] = scnr.nextInt();
candidate1VoteSum += candidate_1_Votes[i];
System.out.print("For Candidate 2: ");
candidate_2_Votes[i] = scnr.nextInt();
candidate2VoteSum += candidate_2_Votes[i];
}
Now that you have your candidate int arrays (candidate_1_Votes and candidate_2_Votes) you can determine which Precinct gave what total votes to whatever Candidate, for example:
for (int i = 0; i < precincts.length; i++) {
System.out.println("n" + precincts[i] + " gave Candidate 1 a total of " +
candidate_1_Votes[i] + " votes.");
System.out.println(precincts[i] + " gave Candidate 2 a total of " +
candidate_2_Votes[i] + " votes.");
}
You don't need two arrays to accomplish this task. You can what is needed with just the array of precincts. It's all a matter of how you ask the User for input and what you do with that input.
You have your precinct array and you are already utilizing it within a for loop. Everything that needs to be acquired can be done through this loop, for example:
String precincts = {"Precinct A", "Precinct B", "Precinct C", "Precinct D"};
int candidate1VoteSum = 0;
int candidate2VoteSum = 0;
for (int i = 0; i < precincts.length; i++) {
System.out.println("nHow many votes were received in: " + precincts[i] + "?");
System.out.print("For Candidate 1: ");
candidate1VoteSum += scnr.nextInt();
System.out.print("For Candidate 2: ");
candidate2VoteSum += scnr.nextInt();
}
Here we merely used two int variables (candidate1VoteSum and candidate2VoteSum)to hold the sum of votes for each candidate. The total votes for each candidate in each precinct is all that is needed. As we iterate through the Precincts we simply ask the User to supply the total votes for each Candidate for that current Precinct.
When the for loop is finished you now have all the necessary data to display to display the voting results, for example:
System.out.println("nCandidate 1 recieved a total of " +
candidate1VoteSum + " votes from all Precincts.");
System.out.println("Candidate 2 recieved a total of " +
candidate2VoteSum + " votes from all Precincts.");
System.out.println("nThe winning Candidate is: " +
// Nested Ternary Operators are used here.
(candidate1VoteSum == candidate2VoteSum ? "It's A Tie!" :
(candidate1VoteSum > candidate2VoteSum ? "Candidate 1" : "Candidate 2"))
);
Here is information on using a Ternary Operator:
If you actually need the total from each Precinct to go into a candidate Array then you can add to the array directly from within the for loop as well but first you will need to declare the integer arrays first and size them to be the same size as the precincts array since each element is only holding the total votes from each Precinct, for example:
String precincts = {"Precinct A", "Precinct B", "Precinct C", "Precinct D"};
int candidate_1_Votes = new int[precincts.length];
int candidate_2_Votes = new int[precincts.length];
int candidate1VoteSum = 0;
int candidate2VoteSum = 0;
// Getting User input with regards to voting results...
for (int i = 0; i < precincts.length; i++) {
System.out.println("nHow many votes were received in: " + precincts[i] + "?");
System.out.print("For Candidate 1: ");
candidate_1_Votes[i] = scnr.nextInt();
candidate1VoteSum += candidate_1_Votes[i];
System.out.print("For Candidate 2: ");
candidate_2_Votes[i] = scnr.nextInt();
candidate2VoteSum += candidate_2_Votes[i];
}
Now that you have your candidate int arrays (candidate_1_Votes and candidate_2_Votes) you can determine which Precinct gave what total votes to whatever Candidate, for example:
for (int i = 0; i < precincts.length; i++) {
System.out.println("n" + precincts[i] + " gave Candidate 1 a total of " +
candidate_1_Votes[i] + " votes.");
System.out.println(precincts[i] + " gave Candidate 2 a total of " +
candidate_2_Votes[i] + " votes.");
}
answered Nov 24 '18 at 5:46
DevilsHndDevilsHnd
3,22711116
3,22711116
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53454095%2fhow-to-find-sum-of-two-user-populated-arrays-separately-in-java%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Right now there's too much missing for us to be any use to you - your best bet is to followup directly with your teacher (assuming you're in school) or go through some more basic array examples (there are tons of these available via google search)
– Krease
Nov 24 '18 at 0:16
Wouldn't you want to enter two numbers per precinct, e.g., one number for each candidate? So you'd likely want two collections of votes (in this specific case).
– Dave Newton
Nov 24 '18 at 0:17