I am trying to make a small example here. Lets say I have an array that looks like this:
userInput = input.nextInt();
int[] numberOfValues;
numberOfValues = new int[10];
for (int x = userInput; x <= userInput+10; x++) {
numberOfValues[x] = x+1;
}
So if the user input 1 then the array would be 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 but if the user inputs 2 then the array would be 2, 3, 4, 5, 6, 7, 8, 9, 10 ,11
How would I display how many of each number there is in the array if the number care different based on user input. I realize that there is only one of each number but my actual program is a lot longer.