Question: please rewrite the program with what's missing 1. getValues: Function that consists of two input parameters, a pointer type variable that points to an array
1. getValues: Function that consists of two input parameters, a pointer type variable that points to an array of integers and the number of elements within the array . The function prompts the user for the elements and place inside the array.
2. getSelectionSort: Function that consists of two input parameters, a pointer type variable that points to an array of integers and the number of elements within the array. The function invokes the Selection Sort algorithm
3. getMedian: Function that consists of two input parameters, a pointer type variable that points to an array of integers and the number of elements within the array. The function calculates the median of the values contents of the previously sorted array.
4. Implement a program that calls the above functions.
5. Use pointer notation in the manipulation of the numeric array.
6. Run your program with the following arrays: n = 6. and for n = 7
Hinclude ciostreams using namespace std; void showArray(const int "array, int size) f for (int count =0; count " ( array+count +1))) (array+count) is for value at address (array+count) temp = *(array + count ) : *(array+count )= * ( array+count +1); - (array+count+1)= temp; swap = true; 1 Jwhile(swap): int main0 f II Array of unsorted values int values [6]={7,2,3,8,9,1}; /IDisplay the values coutce" The unsorted values are : (n ": showArray(values, 6): I/Sort the values sortArray(values,6); WDisplay them again coutee" The sorted values are In=; showArray(values, 6): coutce"Median : "cemedian(values,6); return 0i
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
