Question: A.Reverse Array Write a function that accepts an int array and the arrays size as arguments. The function should create a copy of the array,

 A.Reverse Array Write a function that accepts an int array and

A.Reverse Array Write a function that accepts an int array and the arrays size as arguments. The function should create a copy of the array, except that the element values should be reversed in the copy. The function should return a pointer to the new array. Demonstrate the function in a complete program.

B. Array Expander:

Write a function that accepts an int array and the array s size as arguments. The

function should create a new array that is twice the size of the argument array. The

function should copy the contents of the argument array to the new array, and initialize

the unused elements of the second array with 0. The function should return a

pointer to the new array.

C. Element Shifter

Write a function that accepts an int array and the array s size as arguments. The

function should create a new array that is one element larger than the argument array.

The rst element of the new array should be set to 0. Element 0 of the argument array

should be copied to element 1 of the new array, element 1 of the argument array

should be copied to element 2 of the new array, and so forth. The function should

return a pointer to the new array.

Programming language: C++

(A, B, and C should be in the one program. This question should be one program, not the 3 separate program)

Please create one program to respond to Programming Challenges #10, 11 and 12 at the end Of the chapter. (These challenges are named "Reverse Array", Array Expander" and "Element Shifter") Make sure to declare and initialize the original array inside of main AND THEN call a function to reverse the array and then call another function to expand the array and then call a third function to shift the array. The functions to reverse, expand and shift have to be separate. Each function will return a pointer to the new array that was generated. Main will then call a displayArray function (3 separate times) to display each new array. Here's how I'd like it organized: prototypes main0 declare array declare the pointers reversePointer reverseArray(array, SIZE) expandPointer- expandArraylarray, SIZE) shiftPointer-shiftArray(array, SIZE) displayArray(reversePointer, SIZE) displayArray(expandPointer, SIZE *2) displayArray(shiftPointer, SIZE)

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!