Question: can it be in programming language C, thanks! /* * You can copy and modify the below code */ #include #include /* this function returns

 can it be in programming language C, thanks! /* * You

can it be in programming language C, thanks!

/* * You can copy and modify the below code */ #include #include /* this function returns a random number between [low, high] * double RandomReal(double low, double high){ double d; d = (double) rand() / ((double) RAND_MAX + 1); return (low + d * (high - low)); } int main(int argc, char* argv[]) { int X, Y; double minZ, maxZ; double **Arr2D; printf("Enter X Y minZ maxZ:"); scanf("%d %d %lf %lf", &X, &Y, &minZ, &maxZ); /* dynamically create 2D array of doubles (X row, Y col), * For each i, j * if (minZ == maxZ) Arr2D[i][j] = minZ; * else Arr2D[i][j] = RandomReal(minZ, maxZ); * Then find the sums we want using the given Arr2D ! */ /* YOUR CODE */ return 0; }

Write a program that ask user to enter two integers X and Y, and two doubles minZ maxZ. It then allocates a dynamic 2D array consisting of X rows and Y columns of double values, and sets each value in the 2D array by randomly generating a number between minZ and maxZ. If (minZ- maxZ), then simply set each value in the 2D array to minZ. Then print the overall sum of all the values in the whole 2D array, the sum of each row, and the sum of each column. Here is a sample output When the input is for X Y minZ maxZ Your output should be as follows Overall sum30.0 Sum of each row Row06.0 Rowl6.0 Row26.0 Row3 = 6.0 Row46.0 sum of each c 1umn 10.0 10.0 10.0 At the end we provide the template and a function to generate random numbers. Copy that program and modify it

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!