Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I need help coding these functions in C programming. Here is what the output should look like: In this assignment you are to code each
I need help coding these functions in C programming.
Here is what the output should look like:
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 #de fine RON 20 Consider the following function prototype 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] [0] would have the smallest value. The order is either 1 (ascending order) or 2 (descending order) Example of a 3x3 sort in ascending orders 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 B: 1 2 3 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 B: 1 2 3 7 6 5 Testing an array of size: 3 x 4 Populate Array with unique random integers between 1 and 99 DisplayArray2D: 41 9112 15 81 34 33 25 45 55 94 28 FindLargest: 94 FindColSum of col 0: 167 Sort2DArray order 1 followed by DisplayArray2D: 12 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 runStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started