Display 100 random integers in [10, 25]
14 14 18 24 12 25 16 12 18 16
15 16 16 15 17 19 10 21 14 25
21 24 10 19 25 17 19 13 25 24
23 25 15 25 18 23 18 14 24 11
21 12 20 24 14 18 11 12 14 13
14 20 11 16 21 15 15 17 20 24
10 18 20 18 24 23 17 18 15 11
20 19 14 23 20 23 18 22 20 11
10 24 22 12 10 11 11 12 12 13
14 12 15 15 13 24 23 23 11 23
*************************************************
Display occurrences
10: 5
11: 8
12: 8
13: 4
14: 9
15: 8
16: 5
17: 4
18: 9
19: 4
20: 7
21: 4
22: 2
23: 8
24: 9
25: 6
Max occurrences: 9
Min occurrences: 2
Average occurrences: 6.25
here is my code rite now:
public int[]Occur(int[]Array){
public int[]Occur(int[]Array){
int[]countA= new int[35];
for(int i=0;i<Array.length;i++){
countA[Array[i]]++;
}
return countA;
}
public void displayOccur(int[]countA,int[]Array){
System.out.println("Display Occurrences :");
int num;
for (int i=10;i<=25;i++){
num=+countA[i];
System.out.println(i+": "+ countA[num]);
}
what's wrong with it???/can u help me