Question: For this assignment you must write pseudocode and ccode for several subfunctions that use pointers and amays andaman0 function that calsyor sub tons, printing the
For this assignment you must write pseudocode and ccode for several subfunctions that use pointers and amays andaman0 function that calsyor sub tons, printing the specifed values. The subtunctions you write will have the following prototypes and perform the operations described 1. int sum int arrayD, int asze) returns the sum of the elements of a one dimensional array. 2 int swap int pA int pB) r returns a integer stored at is greater then the integer stored at pe ard swaps two integers returns ootherwise 3 it arrayli int asize: makes one pass through the are not in ascending orde. usng the above Retumsa' ay A vold sort nt amaya, int asizex r sons the values in amay in ascending order using sort 1passo 5. void printamay(nt arrayll, int asizek prints the contents of the array on one line r Use a preprocessor #define drective before main0to set the amay size to 9 elements The main0 function should perform the following actions, and cal the sub-functions above where appropriate 1 and the yourRed ID mumber soifyour Red Dwas 87654210 the value of the frst few elements n the amay would be amay12l and so on The array declaration and intialization should look like this int array() 2. Next main0 should pert al 9 amay values in the amay on a single Ine prior to processing 3 pont the sum of the the digits in the amay using the sum0 function above 4 call function sorto which then calls sort 1pass0, which calls swap0 to swap individual pars the 9 values in the amay on one line after each sort 1Pass0through array 7 the median (middle digt in the sorted average of the digits in the array, accurate to 2 decimal places print the Program submission when you submit the of the lab sesson. You should work on debugging your program in the lab. 1. You should write your code BEFORE the lab session. The program (the esej must be brought with you at of the lab session. 2. copy of the correct output results, the pseudo code, finalCoode should be by the end end the The pseudo code, and he and Doc or PDF file. 4, submit your pseudo code, C source code, and the resulting soreen capture s) a single last Make sure vou name voue Doc PDF REMEMBER: ATTACH YOUR FILE BEFORE YOU CLICK MITI FY2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
