I finished the code but did not add the method for frequency.Could you please add the method for frequency and make sure thecode follows the instructions carefully. Thank you! My code isbelow. Please highlight the changes.
import java.util.Random;
public class AnalyzeNumbers {
public static void main(String args[]) {
Random rnumbers = new Random(); // declaring variables
int[] numbers = new int[10];
for(int i=0; i<10; i++)
numbers[i] = rnumbers.nextInt(5) + 1;
System.out.print(“Array is “);
for(int num: numbers)
{System.out.print(num + ” “);}
System.out.println();
int[] freq = new int[5];
for(int i=0; i<10; i++)
freq[numbers[i]-1]++;
int y=1;
for(int num: freq)
{System.out.println(“Frequency of the number “+ y+ ” is”+num);
y++;
}
int mostfrequent = freq[0];
int index = 0;
for(int i=1; i<5; i++)
if(freq[i] > mostfrequent)
{
mostfrequent = freq[i];
index
PayPal Gateway not configured
PayPal Gateway not configured