Question: Problem: a java program using arrays to solve the problem: to read 100 numbers, get the average of these numbers, and find the number of

Problem: a java program using arrays to solve the problem: to read 100 numbers, get the average of these numbers, and find the number of the items greater than the average. To be flexible for handling any number of input, we will let the user enter the number of input, rather than fixing it to 100.Filename: AnalyzeNumbers.java

Problem: a java program using arrays to solve the problem: to read

Let's Check: { Answer Key) LISTING 7.1 AnalyzeNumbers . java public class AnalyzeNumbers { UN public static void main(String args) { numbers[0] java.util. Scanner input = new java.util. Scanner(System. in) ; numbers[1]: System. out. print("Enter the number of items: "); numbers[2]: int n = input. nextInt(); double numbers = new double[n] ; create array double sum = 0; numbers[i]: 9 System. out. print("Enter the numbers: "); 10 for (int i = 0; i average) above average? 20 count++; 21 22 System. out. printIn("Average is " + average); 23 System. out. printIn("Number of elements above the average is " 24 + count) ; 25 26 Enter the number of items: 10 ~Enter Enter the numbers: 3.4 5 6 1 6.5 7.8 3.5 8.5 6.3 9.5 -Enter Average is 5.75 Number of elements above the average is 6 The program prompts the user to enter the array size (line 5) and creates an array with the specified size (line 6). The program reads the input, stores numbers into the array (line 11), adds each number to sum in line 11, and obtains the average (line 15). It then compares

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!