Advertisement
Guest User

Untitled

a guest
Apr 17th, 2014
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. int x;
  2. char highestChar = '1';
  3. char nextHighestChar = '1';
  4. String alpha = "123456";
  5.  
  6. int largest=intVoteCount[1];
  7. int nextLargest=intVoteCount[1];
  8. for( x=1; x<=range; x++){
  9. if(intVoteCount[x]>largest){
  10. largest = intVoteCount[x];
  11. highestChar = alpha.charAt(intLoopCount);
  12. }
  13. if(intVoteCount[x]>highestChar){
  14. nextLargest = intVoteCount[x];
  15. nextHighestChar = alpha.charAt(intLoopCount);
  16. }
  17. }
  18.  
  19.  
  20.  
  21. System.out.println("The winner is Candidate number "+ highestChar + " with " + largest + " votes.");
  22. System.out.println("The winner is Candidate number "+ nextHighestChar + " with " + nextLargest + " votes.");
  23. System.out.println("-----------------------------");
  24. System.out.println("The Candidate votes are as follows.");
  25.  
  26. for (intLoopCount = 1; intLoopCount <= range; intLoopCount++) {
  27. // Display all records.
  28. // New Instance
  29.  
  30. System.out.println("");
  31. System.out.println("Candidate " + intLoopCount + " "
  32. + strCandidateTitle[intLoopCount] + " "
  33. + strCandidateFirstname[intLoopCount] + " "
  34. + strCandidateSurname[intLoopCount] + " votes "
  35. + intVoteCount[intLoopCount]);
  36.  
  37.  
  38. }
  39. System.out.println("-----------------------------");
  40. System.out.println("Vote Count Spolit: " + intVoteCountSpolit);
  41.  
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement