Answered step by step
Verified Expert Solution
Question
1 Approved Answer
C++ Create a program that: 1. Asks the user for an array size 2. Dynamically allocates an integer array with the desired number of elements.
C++
Create a program that: 1. Asks the user for an array size 2. Dynamically allocates an integer array with the desired number of elements. a. Youre responsible for cleaning up! 3. Ask the user if they would like to: a. input values b. provide a set of rules for randomly generated values to fill the array c. use the default range for random values i. Random values will be generated with the rand function. See end of chapter 8 slides. 4. Fill the array with respect to the users choice 5. Display the array 6. Sort the array (ascending order) using your method of choice 7. Display the array 8. Ask the user if they wish to return to step 1. The array should be recreated if they return to step 1. --- You MUST define and make use of these functions, among any others that feel appropriate: void mySwap(int * a, int * b);//Switches the contents in a and b //Will fill all entries in the array with a number between min and (min + range) void fillRandom(int * arr, int numEntries, int range = 100, int min = 0) --- If youre unfamiliar with pointers, look to the slides and/or try working on this assignment with a regular array first Also valid, and the same to the compiler on some level: void fillRandom(int [] arr, )
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