Question: In C++ Create a program that dynamically allocates an array. Make the following functions for your program: 1. Populate pass in the user inputted size.
In C++
Create a program that dynamically allocates an array. Make the following functions for your program: 1. Populate pass in the user inputted size. Return a dynamically allocated array of that size and populate it with that many random values between 1-100. Then return the populated array. 2. Display pass in a pointer to the array and its size. Display the contents of the array 10 values per line. 3. Swap pass in two integers by reference, then swap their values. 4. Sort pass in a pointer to the array and the size. Sort the contents of the array in ascending order using the swap function. Use selection or bubble sort. 5. Shuffle pass in a pointer to the array and the size. Shuffle the contents of the array by repeatedly (~2x size) swapping two randomly chosen indexes in the array by using the swap function. 6. Max pass in a pointer to the array, and the size. Iterate through the array to find and return the maximum value. 7. Menu write a function that displays the following menu to the user: 1. Display 2. Sort 3. Shuffle 4. Max 5. Quit In your main function: prompt the user for the size of the array, use the getPositiveInt function from the CheckInput file to make sure they entered a valid size. Call your populate function to construct and populate an array of that size. Display the menu to the user and allow them to select an option. Use your getIntRange function to make sure they entered a valid input. Document all functions properly
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
