Write a program that sets up an int array |Software Engineering

Write a program that sets up an int array |Software Engineering

Write a program that sets up an int array which has available positions with subscripts 0 through 199. We wish to enter quite a few integers into this array, but want to fill the array starting in the center, according to the rule: if the new integer is negative it should go in the position with subscript 99 (just left of the center), after moving over to the left by one position all the other integers already stored to the left of center. If the new integer is positive it should go in the position with subscript 100 (just right of the center), after moving over to the right by one position all the other integers already stored to the right of center.

We know the array is large enough to absorb all the new numbers fed in.

One way to write the program uses two functions. The first function accepts the array, the new negative integer, and the number of integers already stored to left of center. The function does the shifting over and puts in the new negative integer, so the array gets changed; it also adds 1 to howmanyonleft. The second function accepts the array, the new positive integer, and the number of integers already stored to right of center. The function does the shifting over and puts in the new positive integer, so the array gets changed; it also adds 1 to howmanyonrt.
Write the program that incorporates these two functions, as described. You will notice that the two functions have very similar statements, so you are doing some repetitive C++ code.

Then write a second program that uses just one function that efficiently will handle either situation. Make the one function as concise and elegant as possible. It should not have repetitive code.

Have your program read the data in from a file. Sample data files – of various lengths – will be posted under Assignments in Blackboard.

Order from us and get better grades. We are the service you have been looking for.