Write a complete program that uses an array and implements the following functio
ID: 3641865 • Letter: W
Question
Write a complete program that uses an array and implements the following functions (the array gets passed to these functions):-print_array prints the values of the array in a human-readable-way.
-find_max returns the maximum value of the array.
-find_min returns the minimum value of the array.
-search search for a specific value. If the value is found in the array, return the index of the array where this value was found. Otherwise return -1 (negative one)
-SORT this function sorts the array in ascending order.
Create at least 4 arrays. The arrays will have the following values:
-first array: 7 7 7 7 7 7 7 7 7 7 7
-second array: 11 10 9 8 7 6 5 4 3 2 1 0 -1 -2
-third array: -2 -1 0 1 2 3 4 5 6 7 8 9 10 11 12 13
-fourth array: -3 4 33 22 9 -100 2 56 57 55 2 90 2234 32 8 123 2 33 22 22 33 -1 -3
Provide source documentation (as always). Make sure your program functions in EVERY case.
Explanation / Answer
Hi, I have completed the Array Util Class. And also provided the results as well. To change to other input change it in the main program. Instead of fourhArray replace with rest of the three. arrayUtil.dispArray(fourthArray); arrayUtil.getMin(fourthArray); arrayUtil.getMax(fourthArray); arrayUtil.getIndex(fourthArray, 9); arrayUtil.sortArray(fourthArray); **************************************************************************** import java.util.Arrays; public class ArrayUtil { /** * To display the array information * * @param array */ public void dispArray(int[] array) { for (int i = 0; iRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.