Question: MUST BE IN C PROGRAMMING! In this assignment you are to code each of the functions specified below. You will then need to test them

MUST BE IN C PROGRAMMING!

In this assignment you are to code each of the functions specified below. You will then need to test them with a main() function that invokes them by producing the same sequence of calls as the sample output run shown.

Assume the following declarative constants:

#define COL 20

#define ROW 20

Consider the following function prototype specifications:

MUST BE IN C PROGRAMMING! In this assignment you are to code

each of the functions specified below. You will then need to test

Specific Requirements: [25 pts]

[ 3 pts x 7] Write the complete definition and documentation for each of the 7 functions given above.

[ 1 pt] Compilation on the CS server gcc compiler without errors and warnings.

[ 3 pts] Demonstrate the complete program using a main function capable of processing the input of any array size (not exceeding ROW and COL).

Failure to properly document your entire code will receive a mark of zero

Sample OUTPUT Run (you should repeat it at least 3 times with different input sizes such as 1x1, 3x4, 20x20, 10x5):

Testing an array of size: 3 x 4

Populate Array with unique random integers between 1 and 99

DisplayArray2D:

41 91 12 15

81 34 33 25

45 55 94 28

FindLargest: 94

FindColSum of col 0: 167

Sort2DArray order 1 followed by DisplayArray2D: 1

2 15 25 28

33 34 41 45

55 81 91 94

CopyArray2D from A to B, then Display B:

12 15 25 28

33 34 41 45

55 81 91 94

CopyArray2DSpiral from A to B, then Display B:

12 15 25 28

81 91 94 33

55 45 41 34

-- end run

Consider the following function proto specifications: void PopulateArray2DUnique (int A [COL], unsigned int rowsize, unsigned int colsize, int min, int max); Populates the 2D Array of sizes rowsize x colsize with random integers ranging between min and max inclusive. void DisplayArray2D (int A [COL], unsigned int rowsize, unsigned int colsize); Display the contents of a 2D array of size rowsize x colsize in a table format; that is each line will display one row where the numbers are separated by a single space character int FindLargest (int A[] [COL],unsigned int rowsize, unsigned int colsize); Given a 2D array A of size rowsize x colsize, return the largest integer number it contains int FindColSum (int A[ [COL], unsigned int rowsize, unsigned int colsize, unsigned int col to sum) Calculate the sum of a given column col of a 2D array of size rowsize x colsize. Return the sum of that column int Sort2DArray (int A [cOL], unsigned int rowsize, unsigned int colsize, int order); Sort a 2D array of size rowsize x colsize in ascending order. i.e A[0] [o] would have the smallest value. The order is either 1 (ascending order) or 2 (descending order) Example of a 3x3 sort in ascending order is shown below: 1 2 3 4 5 6 7 8 9 int CopyArray2D (int A[] [COL],int B[] [cOL], unsigned int rowsize, unsigned int colsize) Copy the contents of array A into array B of the same size such that the contents of B would be exactly the contents of A. e.g. copying A into B: A: 1 2 3 4 5 6-->4 5 6 7 8 9 1 2 3 7 8 9 int CopyArray2DSpiral (int A] [CoL], int B[] [COL], unsigned int rowsize, unsigned int colsize) Copy the contents of array A into array B of the same size such that the contents of B would be exactly the contents of A except they will be in a clockwise spiral sorted order. e.g. copying A into B with Spiral effects: A: 1 2 3 4 5 6-->8 9 4 7 8 9 Hint: you may consider sorting A first before starting. Note that your function should work for any size array up to 20x20 1 2 3 7 6 5

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!