Consider the following function main:

int main()
{
int alpha[20];
int beta[20];
int matrix[10][4];
. . .
}

a) Write the definition of the function inputArray that prompts the user to input 20 numbers and stores the numbers into alpha.

b) Write the definition of the function doubleArray that initializes the elements of beta to two times the corresponding elements in alpha. Make sure that you prevent the function from modifying the elements of alpha.

c) Write the definition of the function copyAlphaBeta that stores alpha into the first five rows of matrix and beta into the last five rows of matrix. Make sure that you prevent the function from modifying the elements of alpha and beta.

d) Write the definition of the function printArray that prints any one dimensional array of type int. Print 15 elements per line.

e) Write a C++ program that tests the function main and the functions discussed in parts a through d. (Add additional functions, such as printing a two-dimensional array, as needed.)

Important Design

Solution needs to be well structured with functions and no global variables. Global constants are fine for using the information about array sizes. All functions must provide single well defined purpose.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.