Question: Functional Requirements: Create a program in Object Oriented with C++ that will dynamically create new arrays. Programming Requrements: In main, create an int array of
Functional Requirements: Create a program in Object Oriented with C++ that will dynamically create new arrays.
Programming Requrements:
In main, create an int array of SIZE 10
1. Call a function that will accept the array and the SIZE, and then dynamically create a new array of the same size. Double the numbers from the original array and then put them into the new array. For example, if the received array was 9, 8, 7, 6, then the new array would be 18, 16, 14, 12. Return a pointer to the new array.
2. Call a display function that will accept the new array and the SIZE and display it.
3. Call a function that will accept the array created in step 1 and SIZE, and then dynamically create a new array that is 3 times as large. Arrange the numbers from the array that was received into the new array so that there are two 0's between each number. For example, if the received array was 18, 16, 14, 12, then the new array would be 18,0,0,16,0,0,14,0,0,12,0,0. Return a pointer to the new array.
4. Call the display function from step 2 and pass it the array created in step 3.
5. Call a function that will accept the array created in step 3. That function will then dynamically create a new array that is the same size. Arrange the numbers from the array that was received into the new array so that they are in numerical order. In the example above, they would be 0,0,0,0,0,0,0,0,12,14,16 ,18. Return a pointer to the new array.
6. Call the display function from step 2 and pass it the array created in step 5.
You cannot just display the dynamically-created arrays in the functions that created them. You MUST display the arrays after the functions have returned their pointer to main.
Make sure code is modular in design, well documented and that the output is professional in appearance. No menu required in this program.
To help us grade, let's initialize the firstArray to 105, 95, 85, 75, 65, 55, 45, 35, 25, 15
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
