Question: LISTING 7.1 AnalyzeNumbers.java 1 public class AnalyzeNumbers { 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

 LISTING 7.1 AnalyzeNumbers.java 1 public class AnalyzeNumbers { public static voidmain(String[] args) { numbers[0] java.util.Scanner input = new java.util.Scanner(System.in); numbers[1]: System.out.print("Enter the

LISTING 7.1 AnalyzeNumbers.java 1 public class AnalyzeNumbers { 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]; double sum = 0; numbers[i]: System.out.print("Enter the numbers: "); for (int i = 0; i average) count++; System.out.println("Average is " + average); System.out.println("Number of elements above the average is " + 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 2. Modifications: 1. We'll have it calculate more than just the average and the number of items above it. Write code that will get the smallest value entered and the location of it in the array. 6.3 9.5 2. The output would look like this: Enter the number of items: 10 Enter the numbers 3.4 5 6 1 6.5 7.8 3.5 8.5 Average is 5.75 Number of elements above the average is 6 The smallest value entered was 1.0 The smallest value was located at index 3

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 Databases Questions!