Question: st%20Resources/Practice%20Tests/Test?6201/Spring%2020 1 7/Blank%20Exams ?preview: 1 22612 Function Name: arrayWork Inputs (1): (double) An MxN array of random numbers. M and N are guaranteed to be

 st%20Resources/Practice%20Tests/Test?6201/Spring%2020 1 7/Blank%20Exams ?preview: 1 22612 Function Name: arrayWork Inputs (1):

st%20Resources/Practice%20Tests/Test?6201/Spring%2020 1 7/Blank%20Exams ?preview: 1 22612 Function Name: arrayWork Inputs (1): (double) An MxN array of random numbers. M and N are guaranteed to be even Outputs (1): (double) An updated MxN array Function Description: numbers You are given an MxN array with even numbers of rows and columns. Your boss tasks you with performing the following series of data crunching tasks. First, swap all of the odd rows with the even rows and vice versa. For example, the first and second rows should swap positions in the example array, and the third and fourth rows should swap positions in the example array Second, take the top half of the array and find the mean of each row. Third, find the maximum of these means. Lastly, triple all values in the array that are evenly divisible by the rounded value (to the nearest integer) of the maximum found earlier Test Case: 2, 6, 1 2, 7, 1 2, 5, 6] out arrayWork (arr) out [2, 12, 1; 1, 2, 5; 2, 5, 12; 2, 7, 11 Example of process: arr= [1, 2, 5; 12, 18, 1; 2,5r_o ; 2, 5, 18; 2, 5, 61 sAverage of top two rows (top half) are 3 and 2.67 respectively

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!