Program Needs Written Java Run Notepad Create Application Containing Array Stores Eight I Q37041766

Program needs to be written in Java. It will run innotepad++.

Create an application containing an array that stores eightintegers. The application should call five methods that inturn:

  1. Display all the integers
  2. Display all the integers in reverse order
  3. Display the sum of the integers
  4. Display all values less than a limiting argument
  5. Display all values that are higher than the calculated averagevalue

Answer


import java.util.Scanner;

public class ArrayEx {
   public static void main(String[] args) {
       int arr[] = new int[8];
       Scanner sc = newScanner(System.in);
       System.out.println(“Enter 8 numbers”);
       for (int i = 0; i < 8;i++)
           arr[i] =sc.nextInt();

       int total

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.