Lab 7c – Scanner, Arrays, and Computations

Create a file named Lab7c.java in your lab7 directory.  Write a program in Lab7c.java that satisfies the following specifications.


    • Read the contents of random.txt and store the random values in an array.
    • Print to the screen the values in the array.
    • Compute
      • the sum of the values in the array,
      • the mean average of the values in the array,
      • the minimum value in the array, and
      • the maximum value in the array.
    • Print to the screen the sum, mean average, minimum, and maximum in a well formatted manner
    • Print to the screen “Greater than mean” followed by a list of the values in the array that are greater than the mean.
    • Print to the screen “Less than mean” followed by a list of the values in the array that are less than the mean.
    • Print to the screen “Closest to mean” followed by the value in the array that is closest to the mean.

Test your program and when satisfied that it is correct, push to GitHub.

© 2024, Eric. All rights reserved.