Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

This program will require you to: Ask user to enter the length of the array Read

ID: 3830689 • Letter: T

Question

This program will require you to:

Ask user to enter the length of the array

Read in that length and use it to create an array of integers

Write a loop that asks the user to enter an integer and then reads it into the array

Write a loop that finds the max of the array

Write a loop to find the min of the array

Write a loop to find the average of the array(be careful with int division)

Write a loop to find the number of numbers in array divisible by 5

Write a loop to print the array

Write a loop to print the array backwards

Find the smallest two numbers in the array

** Do not use java imports other than scanner.

Example output

----jGRASP exec: java Loop Enter array length
7
Enter value

21
Enter value 23
Enter value 56
Enter value

76
Enter value 89
Enter value 45
Enter value 34
The max is 89

The min is 21
The average is 49.142857142857146
The number of numbers divisible by 5 is is 1
The array forward is 21 , 23 , 56 , 76 , 89 , 45 , 34 , The array reversed is 34 , 45 , 89 , 76 , 56 , 23 , 21 , The smallest two numbers are 21 and 23

You can get 1 extra credit point if you figure out how to not have the last number be followed by a ,

Explanation / Answer

Hi, I will update in next 20 minutes:

import java.util.Scanner;

public class ArrayOp {

  

   public static void main(String[] args) {

      

       Scanner input = new Scanner(System.in);

      

       System.out.print("Enter N value: ");

       int n = input.nextInt();

      

       int[] arr = new int[n];

      

       for(int i=0; i<n; i++){

           System.out.print("Enter value ");

           arr[i] = input.nextInt();

       }

      

      

   }

}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote