Question: Use C++ functions and arrays to solve the following problems 1. Below is an outline of the Main function of the first program: - Declare

Use C++ functions and arrays to solve the following problems

1. Below is an outline of the Main function of the first program: - Declare an array (or vector) of size 100. - Call a function to fill the array randomly. Assume the same seed of 1 for reproducibility of output. - Call a function to print the content of the array. This function should allow two possibilities: left_to_right or right_to_left. The function should have a default Boolean argument for that purpose. If set to true, print the array content from left to right. If otherwise set to false, print the array content in reverse order. - Call a function to print all distinct values in the array. - Call a function to separate even and odd numbers of the array into two separate arrays. - Call a function to display all pairs of elements that respect the following property: (Array element i) > (Array element j) when i < j The function should return the number of such pairs. - Call a function that reads the array content number by number and after every read element, the function should display the median up to the currently read array element

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!