Question: Find Highest, Lowest, Average(JAVA) Arrays Overview Utilize methods to find and return the highest value in an array. Requirements main() method Declares an array that
Find Highest, Lowest, Average(JAVA) Arrays
Overview
Utilize methods to find and return the highest value in an array.
Requirements
main() method
Declares an array that will hold 10 integers.
Write a loop that will initialize each array element to a random integer in the inclusive range of -100 through
100. (100 and -100 are also potentially generated)
Use the displayValues() method to show all the elements of the array.
Use a print statement to display the highest number in the array. This number will be returned by the method findHighest().
Use a print statement to display the lowest number in the array. This number will be returned by the method findLowest().
Use a print statement to display the average of all the numbers in the array. This number will be returned by the method findAverage().
Use the displayValues() method to show all the elements of the array one more time
findHighest() method
Takes an array of integers as a parameter. You may assume the array has at least one integer.
Set the initial highest value to be the first integer in the array and then loop through the rest to determine the highest integer value. The highest value is returned.
findLowest() method
Takes an array of integers as a parameter. You may assume the array has at least one integer.
Set the initial lowest value to be the first integer in the array and then loop through the rest to determine the lowest integer value. The lowest value is returned.
findAverage() method
Takes an array of integers as a parameter. You may assume the array has at least one integer.
Loop through the array to determine the average of all the integer values in the array. The average value is returned.
displayValues() method
Takes an array of integers as a parameter. You may assume the array has at least one integer.
Loop through the array to display all the integer values stored in the array. Nothing is returned.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
