Create a project titled Lab10_DynamicInt. Write a program that dynamically stores and then prints the array of user-input integers. Your program should ask the user for the number of integers to be entered. Then the program should allocate the appropriate-size array dynamically, store the integers and then print them out. You should use this template for your program. Here is an example dialog of your program:
Enter number of integers: 5 Enter integers: -3 -4 6 7 23 You entered: -3 -4 6 7 23
Here is an example program dialog:
enter operation [a/r/q] and number: a 5 your numbers: 5 enter operation [a/r/q] and number: a 8 your numbers: 5 8 enter operation [a/r/q] and number: r 8 your numbers: 5 enter operation [a/r/q] and number: a 3 your numbers: 3 5 enter operation [a/r/q] and number: a 12 your numbers: 3 5 12 enter operation [a/r/q] and number: q
The size of the user input can be arbitrarily large. For this program, to accommodate user input, you need to implement an integer array whose size varies as necessary. The numbers in the array should not be sorted. You should use the functions prototyped in this header file. The functions there are as follows:
Note that since the pointer is passed by reference, the call to this function results in effectively "enlarging" the array pointed to by the pointer.
Note that the function should not change an array in any way if the number is not present in it. If the number is present, then the function should allocate a new array of smaller size and then copy all the numbers to it, except the one that needs to be erased. After copying is done, deallocate the old array and update the array pointer to point to the new array.
create copy of the original array by invoking copyArray() then operate on the copy as it will be destroyed during printout while array is not empty assume that the first element of the array is the smallest found number for each subsequent element in the array - compare with the smallest if the element is smaller update the smallest found print the smallest found number call removeNumber() with the smallest found to be removed
Hint: Study this example code to see the techniques to use for the above functions.