1. (20 points)
Write a Java program that asks the user to input a positiveinteger n first, then create an array of size n. Fill n randomintegers between 5 and 555, inclusively, into the created array.Output the sum of all the integers in the array and the average ofall the integers in the array.
2. (10 points)
Find the output of the following Java program and explain youranswer.
public class NO2HW1
{
public static void main(String args[])
{
int min = 100;
int a = 10;
int b = 20;
min_method(a, b, min);
System.out.println(min);
}
public static void min_method(int n1, int n2, int min)
{
if (n1 < n2)
min = n1;
else
min = n2;
PayPal Gateway not configured
PayPal Gateway not configured