Question: Do all the task in JAVA ecclipse (0-5) theyre all link together/ modifyng code after completing 1 task at a time thanl task 0 Create
Do all the task in JAVA ecclipse (0-5) theyre all link together/ modifyng code after completing 1 task at a time thanl
task 0
Create a static method display1DArray that accepts a 1D integer array of any length and displays the values in the array on a single line with a space between each value.
uYou must use an enhanced for loop .
Create an overloaded version of this method to display 1D double arrays
task 1
Create a static method borderSum that accepts a 2D Square integer array of any length and returns the sum of columns and rows as shown below. You must use an enhanced for loop and all calculations must be performed inside the loop. You may create and use any helper methods inside this method.
task 2
Create a static method findCommon that accepts any two 2D Square integer arrays of the same length and returns a 1D integer array that contains the numbers that are common to both arrays. You must use an enhanced for loop and all checks must be performed inside the loop. You may create and use any helper methods inside this method.
task 3
Create a static method sumLeftRightDiagonals that accepts any two 2D Square integer arrays of the same length and returns a 1D array that contains the left diagonal from the first array and the right diagonal from the second array and the last index of the 1D array is the sum of the left and right diagonal values.
You must use an enhanced for loop and all calculations must be performed inside the loop.
You may create and use any helper methods inside this method.
Task 4
Create a static method blocksStats that accepts a 6 x 2 integer array and returns a 1D double array of length 3 that contains the maximum, mean, and minimum value of the specified indices as shown in the diagram below.
You must use an enhanced for loop and all calculations must be performed inside the loop.
You may create and use any helper methods inside this method.
Task 5
Create a static method pseudoFibonacci that accepts a Square 2D integer array of any length and displays a 1D array that contains the Fibonacci sequence of the numbers in the array and returns the sum of the Fibonacci sequence.
The Fibonacci sequence follows this pattern
1 2 3 4 1 + 2 = 3 + 2 = 5 + 3 = 8
You may create and use any helper methods inside this method.





0 1 2 3 0 1 2 3 1 0 1 1 F 2 1 8 9 . 3 4 5 1 1 3 0 1 2 5 2 0 1 2 4 5 6 7 8 9 3 1 0 1 2 3 4 78 0 012 18 0 0 1 4 14 4 0 1 1 11 2 13 4 15 6 7 18 9 9 16 9 2 3 9 ) 0 1 2 3 4 5 6 7 8 9 0123456 15 9 3 5 2 25 0 0 12 23 56 18 1 SUM 2. -- 12 26 Maximum Value in 2 0 1 8 4.5 5 11 1 2 5 | 6 | 7 | 8 8 12 17 23 30 38 47 7 8 9 0 12 3 3 5 9 14 31 4 S - Testing Setup Create your main method as shown in order to facilitate testing and gradi practice exam 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 168 69 public static void main(String[] args) { //TASK 1 int[][] A = {(1,2,3), (4,5,6},{7,8,9}}; int[][] B = {{1,2,3,1,1},{4,6,7,2,2},{3, 1,8,9,3}, {2,7,3,5,1}, {5,1,1,1,3}}; System.out.println(borderSum(A); System.out.println(borderSum(A)); //TASK 2 int[][] C = {{1,2,3}, {4,5,6}, {7,8,9}}; int[][] D = {{11,2,13},{4, 15,6},{7,18,9}}; int[[] E = {{1,1,3,2}, {5,1,3,2}, {6,8,1,2},{1,7,8,0}}; int[] F = {{1,4,4,4},{8,1,1,1},{9,9,9,9},{0,9,9,9}}; This is display1DArray (findCommon (C,D)); main display1DArray (findCommon (E,F)); //TASK 3 int[][] G = {{1,2,3}, {4,5,6},{7,8,9}}}| int[][] H = {{0,2,3), (4,5,6), (2,8,1}}; display1DArray(sumLeftRightDiagonals (G,H)); //TASK 4 int[][] ) = {{1,2), (2,6), (3,5), (2,4}, {6,8},{11,12}}; display1DArray(blockStats (5)); //TASK 5 int[[] K = {(1,2,3), (4,5,6},{7,8,9}}; int[][] L = {{1,2},{4,5}}; System.out.println((pseudoFibonacci(K))); System.out.println((pseudoFibonacci(L))); }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
