Problem

Consider the following function main: a. Write the definition of the function...

Consider the following function main:

a. Write the definition of the function set Zero that initializes any one-dimensional array of type int to 0.

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

c. 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.

d. Write the definition of the function copyGamma that sets the elements of the first row of inStock to gamma and the remaining rows of inStock to three times the previous row of inStock. Make sure that you prevent the function from modifying the elements of gamma.

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

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

g. Write the definition of the function setInStock that prompts the user to input the elements for the first column of inStock. The function should then set the elements in the remaining columns to two times the corresponding element in the previous column, minus the corresponding element in delta.

h. Write C++ statements that call each of the functions in parts a through g.

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

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
Solutions For Problems in Chapter 9
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT