Question: IN C++ FORMAT Write a program that creates a pointer to a dynamic array of integers of size 10. The program will load the array

IN C++ FORMAT

Write a program that creates a pointer to a dynamic array of integers of size 10. The program will load the array with values from 1 to 10 then:

Using the following functions:

A function that accepts the pointer to the integer array and the array size as a arguments, creates a pointer to a new copy of the array, except the values will be reversed in the copy. The function should return the pointer to the new array.

A function that accepts the integer array, and the array size as an argument. The function should create a new array that is twice the size of the original array. It should copy the original array information in and then initialize the unused elements to 0. It should return a pointer to the new array.

A function that accepts the integer array, and the array size as an argument. The function should create a new vector object that is twice the size of the original array. It should copy only the even values of the original array information into the new vector and then initialize the unused elements to 0. It should return a pointer to the new vector.

A function that accepts the integer array and the array size as a arguments. It should print the array's data with spaces between the numbers

Any other function you need.

In main,

print the array

call the reverse function,

print the reversed array,

call the doubling function

print the doubled array

call the vector creator function

print the vector.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!