Reference no: EM132322733
Module - Code design and Implementation Assignment
Please consider the 2 code writing tasks and choose 1 to implement.
Code file naming convention for this and all subsequent assignments familynameTask1 if you choose option 1 or familynameTask2 for option 2 in either case the only capital letter is the “T” from task. This task must be implemented within a single file.
Task 1 - The Location class
Design a class named Location for locating a maximal value (Liang 9.13) and its location in a twodimensional array. The class contains public data fields row, column, and maxValue that store the maximal value and its indices in a two-dimensional array with row and column as int types and maxValue as a double type.
Write the following method that returns the location of the largest element in a two-dimensional array:
- public static Location locateLargest(double[][] a)
The return value is an instance of Location. Write a test program that prompts the user to enter a two-dimensional array and displays the location of the largest element in the array. Here is a sample run (note input style difference from last module task 2):
Task 2 - Sort ArrayList
Write a program with the following method that sorts an ArrayList of numbers:
- public static void sort(ArrayList<Integer> list)
Write a test method within the program that prompts the user to enter 5 numbers, stores them in an array list, displays them in increasing order, followed by their total (sum) value. Here is a sample run:
Enter 5 integers: -1 3 2 5 4
Sorted -1 2 3 4 5 Sum 13...