Question: Write a second version of the median program ( median 2 . cc ) which repeatedly asks the user to enter a positive number, and
Write a second version of the median program mediancc which repeatedly asks
the user to enter a positive number, and displays the median of the list of numbers
entered so far. You should start with an array of size and increase the size of the
array each time a new number is entered. Exit the program when the user entered an
integer which is negative or You should write the function:
int resizeint A int n;
which increases the size of an array of n elements to n elements. The first n elements
should be copied to the new array. The pointer to the array is returned, and the
original array passed into resize is deleted. An array of size should be represented
by the nullptr pointer.
Sample session:
Enter a positive integer to quit:
The median so far is
Enter a positive integer to quit:
The median so far is
Enter a positive integer to quit:
The median so far is
Enter a positive integer to quit:
The median so far is
Enter a positive integer to quit:
The median so far is
Enter a positive integer to quit:
The median so far is
Enter a positive integer to quit:
The median so far is
Enter a positive integer to quit:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
