Question: 1. Create a class called ArrayReview with one data field of an integer array. (5 points) 2. Add a constructor to populate the array in
1. Create a class called ArrayReview with one data field of an integer array. (5 points)
2. Add a constructor to populate the array in the class, and a setter/getter for the array. (5 points)
3. Create a main method to print the integer array after sorted. (5 points)
4. Add the following methods to the class and use them in the main method: (5 points)
a. setKthItem(k, item) that set the kth element of the array to the value given in item.
b. pickMaxIndex(arr, start, end) that returns the index of the largest value of the array from index start to index end.
c. selectionSort() that sorts the array.
Bonus: (5 points)
5. Popular your array with data from an input file, after sorting, print out the data to an output file.
6. Add a two-dimension array to your data field, sort each row and sort each column.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
