Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int x;
- char highestChar = '1';
- char nextHighestChar = '1';
- String alpha = "123456";
- int largest=intVoteCount[1];
- int nextLargest=intVoteCount[1];
- for( x=1; x<=range; x++){
- if(intVoteCount[x]>largest){
- largest = intVoteCount[x];
- highestChar = alpha.charAt(intLoopCount);
- }
- if(intVoteCount[x]>highestChar){
- nextLargest = intVoteCount[x];
- nextHighestChar = alpha.charAt(intLoopCount);
- }
- }
- System.out.println("The winner is Candidate number "+ highestChar + " with " + largest + " votes.");
- System.out.println("The winner is Candidate number "+ nextHighestChar + " with " + nextLargest + " votes.");
- System.out.println("-----------------------------");
- System.out.println("The Candidate votes are as follows.");
- for (intLoopCount = 1; intLoopCount <= range; intLoopCount++) {
- // Display all records.
- // New Instance
- System.out.println("");
- System.out.println("Candidate " + intLoopCount + " "
- + strCandidateTitle[intLoopCount] + " "
- + strCandidateFirstname[intLoopCount] + " "
- + strCandidateSurname[intLoopCount] + " votes "
- + intVoteCount[intLoopCount]);
- }
- System.out.println("-----------------------------");
- System.out.println("Vote Count Spolit: " + intVoteCountSpolit);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement