Question: This assignment is not mandatory. Use your preferred programming language to solve the following scenario. You are given a dynamically allocated 2D (two-dimensional) array with

This assignment is not mandatory.

Use your preferred programming language to solve the following scenario. You are given a dynamically allocated 2D (two-dimensional) array with (5000 x 5000) floating point values. Bear in mind that the access to this array could be carried out only through the following function/method: i) function GetElement(x, y); this function returns the value of the element whose indices are x and y; ii) function PutElement(x, y, value) that changes the existing value of the element whose indices are x and y.

Carry out the following actions sequentially with three separate loops for each of these three actions; remember to manipulate the array only by using the GetElement and PutElement functions: a. in each location of the array, put a new value, d = 1.415 b. replace the value in each location by its value multiplied by itself c. calculate the sum of all of the elements in the array.

Finally, calculate the CPU processing time which are used for the execution of these actions.

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 General Management Questions!