Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a second version of the c + + median program ( median 2 . cc ) which repeatedly asks the user to enter a
Write a second version of the c 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
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