Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases In Networked Information Systems 6th International Workshop Dnis 2010 Aizu Wakamatsu Japan March 2010 Proceedings Lncs 5999

Authors: Shinji Kikuchi ,Shelly Sachdeva ,Subhash Bhalla

2010th Edition

3642120377, 978-3642120374

More Books

Students also viewed these Databases questions

Question

explain the need for human resource strategies in organisations

Answered: 1 week ago

Question

describe the stages involved in human resource planning

Answered: 1 week ago