Array sorting input
i requer help with the array sorting input. so the story is next i am making a code to input the vote number of the candidates ( there are 5 of them) and output the amount of wotes for each candidate. also it need to terminate when the -1 is entered. i have figured all the sorting and swaping functions and have problems with actual input code. what i have so far is not right but it might give you an idea. 


import java.util.*;

public class VoteCount {

    public static void main(String[] args) {
        //create empty array
        int[] votes = new int[5];

        //input data
        input(votes);

    }

    public static void input(int[] votes) 
    {
        Scanner kybd = new Scanner(System.in);
        System.out.println("Enter vote number of the candidate results: ");
        int votecount = kybd.nextInt();
        
        while (votecount !=-1) 
        {
            votes[votecount]++;  
            System.out.println("Candidate" + votes +"Has" +votecount + "votes");
        
        }
        


    }
}

Array sorting input
===

i requer help with the array sorting input. so the story is next i am making a code to input the vote number of the candidates ( there are 5 of them) and output the amount of wotes for each candidate. also it need to terminate when the -1 is entered. i have figured all the sorting and swaping functions and have problems with actual input code. what i have so far is not right but it might give you an idea. 


import java.util.*;

public class VoteCount {

    public static void main(String[] args) {
        //create empty array
        int[] votes = new int[5];

        //input data
        input(votes);

    }

    public static void input(int[] votes) 
    {
        Scanner kybd = new Scanner(System.in);
        System.out.println("Enter vote number of the candidate results: ");
        int votecount = kybd.nextInt();
        
        while (votecount !=-1) 
        {
            votes[votecount]++;  
            System.out.println("Candidate" + votes +"Has" +votecount + "votes");
        
        }
        


    }
}
