Hi, I am required to: Create an array of 100 integers using a random generator. ( 1 for loop) Provide the sum and average of the array. (1 for loop) Find the smallest and largest number in the array....


Hi, I am required to:



  • Create an array of 100 integers using a random generator. ( 1 for loop)

  • Provide the sum and average of the array. (1 for loop)

  • Find the smallest and largest number in the array. Determine its position in the array. (2 for loops)

  • How many numbers are below the average, and how many numbers are above the average. (1 for loop)

  • Print all data to the console, but do not print the array to the console.


I need details how this is coded step by step in java.


I already started on the code and I have:


public class Project_7

{
public static void main(String[] args)

{


Random randomNum = new Random();
double[] arrayNum = new double[100];


for(int i=0;i
{
arrayNum[i]=Math.random()*100;
System.out.println(arrayNum[i]);
}


int sum = 0;
for(int i=0; i
{
sum += arrayNum[i];
System.out.println("Sum is" + sum );
}


double average = sum/100;



Its not perfect but its a start. Please include details for each step so I can understand. Thank you!



Jun 04, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions ยป

Submit New Assignment

Copy and Paste Your Assignment Here