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
Step: 1
Get Instant Access with AI-Powered 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